hydra-queue-runner: Cache the lookup of time spent per jobset
[?]
Sep 21, 2013, 7:54 PM
X3YLTWJAF7QLQGUVGDYALE75W4SJIOYZEFSGG726XRPGN576TWVQCDependencies
- [2]
GEADFVZ5hydra-queue-runner: Improved scheduling - [3]
YEXD7CBKFix findBuildDependencyInQueue - [4]
NREF6YOA* Don't start more builds concurrently than allowed for each system - [*]
7YBYT2LQ
Change contents
- edit in src/script/hydra-queue-runner at line 110
my $timeSpentPerJobset; - edit in src/script/hydra-queue-runner at line 122
my $costPerBuild = 30; - replacement in src/script/hydra-queue-runner at line 130
my $duration = $jobset->builds->search({ },{ where => \ ("(finished = 0 or (me.stoptime >= " . (time() - $windowSize) . "))"), join => 'buildsteps', select => \ "sum(coalesce(buildsteps.stoptime, ${\time}) - buildsteps.starttime)", as => "sum" })->single->get_column("sum") // 0;my $timeSpent = $timeSpentPerJobset->{$b->get_column('project')}->{$b->get_column('jobset')}; - replacement in src/script/hydra-queue-runner at line 132
# Add a 30s penalty for each started build. This# is to account for jobsets that have running# builds but no build steps yet.$duration += $jobset->builds->search({ finished => 0, busy => 1 })->count * 30;if (!defined $timeSpent) {$timeSpent = $jobset->builds->search({ },{ where => \ ("(finished = 0 or (me.stoptime >= " . (time() - $windowSize) . "))"), join => 'buildsteps', select => \ "sum(coalesce(buildsteps.stoptime, ${\time}) - buildsteps.starttime)", as => "sum" })->single->get_column("sum") // 0;# Add a 30s penalty for each started build. This# is to account for jobsets that have running# builds but no build steps yet.$timeSpent += $jobset->builds->search({ finished => 0, busy => 1 })->count * $costPerBuild;$timeSpentPerJobset->{$b->get_column('project')}->{$b->get_column('jobset')} = $timeSpent;} - edit in src/script/hydra-queue-runner at line 188
$timeSpentPerJobset->{$jobset->get_column('project')}->{$jobset->name} += $costPerBuild;