[PATCH 1/3] testbot: Keep track of the completed jobs and tasks.

Francois Gouget fgouget at codeweavers.com
Sun Feb 11 18:33:59 CST 2018


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 at 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;
+      }
     }
   }
 
-- 
2.15.1




More information about the wine-devel mailing list