Over short periods the rate at which jobs and tasks are created does not necessarily match the one at which they are completed. We are already tracking the creation rates so we should track the completion rates too so they can be compared.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/lib/WineTestBot/Activity.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm index 4aed4ed0c..c76b21ee5 100644 --- a/testbot/lib/WineTestBot/Activity.pm +++ b/testbot/lib/WineTestBot/Activity.pm @@ -368,7 +368,9 @@ sub GetStatistics($;$) foreach my $Task (@{$Tasks->GetItems()}) { $GlobalStats->{"newtasks.count"}++ if ($CountsAsNew); + next if (!$Task->Ended or $Task->Ended < $Cutoff); + $GlobalStats->{"donetasks.count"}++;
# $Task->Started should really be set since $Task->Ended is if ($Task->Started and $Task->Status !~ /^(?:queued|running|canceled)$/) @@ -393,12 +395,15 @@ sub GetStatistics($;$) } }
- if (!$IsSpecialJob and $Job->Ended and $Job->Ended >= $Cutoff and - $Job->Status !~ /^(?:queued|running|canceled)$/) + if ($Job->Ended and $Job->Ended >= $Cutoff) { - my $Time = $Job->Ended - $Job->Submitted; - _AddFullStat($GlobalStats, "jobs.time", $Time, undef, $Job); - push @JobTimes, $Time; + $GlobalStats->{"donejobs.count"}++; + if (!$IsSpecialJob and $Job->Status !~ /^(?:queued|running|canceled)$/) + { + my $Time = $Job->Ended - $Job->Submitted; + _AddFullStat($GlobalStats, "jobs.time", $Time, undef, $Job); + push @JobTimes, $Time; + } } }