* hydra: added index, actual build time (buildstep with same outpath, so without deps) of the build

This commit is contained in:
Rob Vermaas 2010-02-11 12:23:46 +00:00
parent 14a1e6db61
commit 68c60b4c66
4 changed files with 17 additions and 2 deletions

View file

@ -58,8 +58,14 @@ sub view_build : Chained('build') PathPart('') Args(0) {
, system => $build->system , system => $build->system
, finished => 1 , finished => 1
, buildstatus => 0 , buildstatus => 0
, 'me.id' => { '<=' => $build->id }
}
, { join => "actualBuildStep"
, "+select" => ["actualBuildStep.stoptime - actualBuildStep.starttime"]
, "+as" => ["actualBuildTime"]
, order_by => "id DESC"
, rows => 50
} }
, { order_by => "id DESC", rows => 100 }
) )
]; ];
} }

View file

@ -217,6 +217,14 @@ __PACKAGE__->belongs_to(
{ id => "id" }, { id => "id" },
); );
__PACKAGE__->has_one(
"actualBuildStep",
"Hydra::Schema::BuildSteps",
{ 'foreign.outpath' => 'self.outpath'
, 'foreign.build' => 'self.id'
},
);
sub addSequence { sub addSequence {
my $hydradbi = getHydraDBPath; my $hydradbi = getHydraDBPath;
if ($hydradbi =~ m/^dbi:Pg/) { if ($hydradbi =~ m/^dbi:Pg/) {

View file

@ -430,7 +430,7 @@
var d = []; var d = [];
var ids = []; var ids = [];
[% FOREACH prevbuild IN prevBuilds %][% IF prevbuild.resultInfo.starttime != 0 %] [% FOREACH prevbuild IN prevBuilds %][% IF prevbuild.resultInfo.starttime != 0 %]
d.push([[% prevbuild.resultInfo.starttime * 1000 %],[% prevbuild.resultInfo.stoptime - prevbuild.resultInfo.starttime %]]); d.push([[% prevbuild.resultInfo.starttime * 1000 %],[% prevbuild.get_column('actualBuildTime') %]]);
ids[[% prevbuild.resultInfo.starttime * 1000 %]] = [% prevbuild.id %] ; ids[[% prevbuild.resultInfo.starttime * 1000 %]] = [% prevbuild.id %] ;
[% END %][% END %] [% END %][% END %]

View file

@ -431,6 +431,7 @@ create index IndexBuildSchedulingInfoOnBuild on BuildSchedulingInfo(id); -- idem
create index IndexBuildStepsOnBuild on BuildSteps(build); create index IndexBuildStepsOnBuild on BuildSteps(build);
create index IndexBuildStepsOnDrvpathTypeBusyStatus on BuildSteps(drvpath, type, busy, status); create index IndexBuildStepsOnDrvpathTypeBusyStatus on BuildSteps(drvpath, type, busy, status);
create index IndexBuildStepsOnOutpath on BuildSteps(outpath); create index IndexBuildStepsOnOutpath on BuildSteps(outpath);
create index IndexBuildStepsOnOutpathBuild on BuildSteps (outpath, build);
create index IndexBuildsOnFinished on Builds(finished); create index IndexBuildsOnFinished on Builds(finished);
create index IndexBuildsOnIsCurrent on Builds(isCurrent); create index IndexBuildsOnIsCurrent on Builds(isCurrent);
create index IndexBuildsOnJob on Builds(project, jobset, job); create index IndexBuildsOnJob on Builds(project, jobset, job);