BB2KXLXZ7NTYXKP7DHSPDKLKZG4LCV3YP7NRT4Q5AY5Q2KUPA4EQC
O5DYTVGAAJRLN2LMLCGHRDCASLLXNY4JITO7AGAGQ26OM4QZ6YLQC
TBSIVFLONPQQXFUMCHHI3GLZS63DFIYQPJOOKK7UVGFOI424AG3AC
6GZZDDQBAIAZJAESJDIT5JKVY6F7IQTJHG6QT2HHBMK2EWE2MHCQC
36M6DGITWMQQGZ7VROEHUOY4FP7OHPJ5DXMQMHHISBIAJLQE24YAC
VBWHG272ASPCVRBVSR7B2VXAPSSYXTWFMAN6ZV2KEQUHWLRRPYYQC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
KSBB33RE2PK5SFN7ZMOTZJQHZB4JYIIUUKWDSD3LSZ5GD465AJHQC
DEMSSSB22UI2ZN26C56UYO4NZWMDCRYKLAQARGOTSORSDXX3ZNNQC
D5QIOJGPKQJIYBUCSC3MFJ3TXLPNZ2XMI37GXMFRVRFWWR2VMTFAC
2GUAKGTBTNFFER343SQWSLFYIXXHJLDSGH5JHF7QMC3AVZB7Q3TQC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
3PNG7NIBQQURUUPRVQXYL342OT7JUUYOMY2JJNP6YDX7SYJDZMYAC
NW3ZYPCMDAFPCVDJ5HQ4EHGFDMI3U2Z4GCM6A6ER7NVRJVV4TCVAC
IK53RV4VGOHLCZGQCCIKPB45M3C7M7YMNBOJFBGZJ4LWIZNU4QNQC
XAJFR6SR6Q56FCL3VYQTP534HD7JFZAMCYY376Y7DVZY4BXM2UWQC
WGUKOIQZOQ64I6OJHGR4RSRI2HPH4RXADNSPFBWRETKO7OWCET4QC
ODNCGFQ5FPKFI624BVMLW7PJ2EFJOR3TY66OCZM42UNNTWBCF2TQC
}
sub history_graphs : Chained('buildChain') PathPart('history-graphs') {
my ($self, $c) = @_;
my $build = $c->stash->{build};
if ($build->finished) {
$c->stash->{prevBuilds} = [$c->model('DB::Builds')->search(
{ project => $c->stash->{project}->name
, jobset => $c->stash->{jobset}->name
, job => $c->stash->{job}->name
, 'me.system' => $build->system
, finished => 1
, buildstatus => 0
, 'me.id' => { '<=' => $build->id }
}
, { join => "actualBuildStep"
, "+select" => ["actualBuildStep.stoptime - actualBuildStep.starttime"]
, "+as" => ["actualBuildTime"]
, order_by => "me.id DESC"
, rows => 50
}
)
];
}
$c->stash->{template} = 'build-history-tab.tt';
}
sub build_times : Chained('job') PathPart('build-times') Args(0) {
my ($self, $c) = @_;
my @res = $c->stash->{job}->builds->search(
{ finished => 1, buildstatus => 0, closuresize => { '!=', 0 } },
{ join => "actualBuildStep"
, "+select" => ["actualBuildStep.stoptime - actualBuildStep.starttime"]
, "+as" => ["actualBuildTime"],
, order_by => "id" });
$self->status_ok($c, entity => [ map { { id => $_->id, timestamp => $_ ->timestamp, value => $_->get_column('actualBuildTime') } } @res ]);
[% PROCESS common.tt %]
[% PROCESS "product-list.tt" %]
[% USE HTML %]
[% USE Date %]
<h3>Build time history (in minutes)</h3>
<div id="placeholder" style="width:800px;height:400px;"></div>
<div id="overview" style="margin-left:50px;margin-top:20px;width:600px;height:50px"></div>
<script src="[% c.uri_for("/static/js/flot/jquery.flot.js") %]" type="text/javascript"></script>
<script src="[% c.uri_for("/static/js/flot/jquery.flot.selection.js") %]" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var d = [];
var ids = [];
[% FOREACH prevbuild IN prevBuilds; IF prevbuild.build.starttime != 0 %]
d.push([[% prevbuild.starttime * 1000 %],[% prevbuild.get_column('actualBuildTime') / 60 %]]);
ids[[% prevbuild.starttime * 1000 %]] = [% prevbuild.id %] ;
[% END; END %]
var options = {
xaxis: { mode: "time" },
selection: { mode: "x" },
points: { show: true },
lines: { show: true },
grid: {
clickable: true,
hoverable: true,
hoverFill: '#444',
hoverRadius: 4,
},
};
var plot = $.plot($("#placeholder"), [d], options);
var overview = $.plot($("#overview"), [d], {
series: {
lines: { show: true, lineWidth: 1 },
shadowSize: 0
},
xaxis: { ticks: [], mode: "time" },
yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },
selection: { mode: "x" }
});
// now connect the two
$("#placeholder").bind("plotselected", function (event, ranges) {
// do the zooming
plot = $.plot($("#placeholder"), [d],
$.extend(true, {}, options, {
xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
}));
// don't fire event on the overview to prevent eternal loop
overview.setSelection(ranges, true);
});
$("#overview").bind("plotselected", function (event, ranges) {
plot.setSelection(ranges);
});
$("#placeholder").bind("plotclick", function (e, pos, item) {
if (item) {
plot.highlight(item.series, item.datapoint);
buildid = ids[item.datapoint[0]];
window.location = "/build/"+buildid;
}
});
});
</script>