The number of tasks that got run on a VM host (running.time.count) is not a proxy for the number of tasks that got created for that VM host since not all tasks get run, for instance if the build fails. Furthermore, when computing rates over short periods, the rate at which tasks get completed on a given VM host is not the same as the rate at which they get created, just as it is for jobs.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/lib/WineTestBot/Activity.pm | 14 ++++++++++++-- testbot/web/Stats.pl | 6 +++--- 2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm index c76b21ee5..3016b14d6 100644 --- a/testbot/lib/WineTestBot/Activity.pm +++ b/testbot/lib/WineTestBot/Activity.pm @@ -367,10 +367,20 @@ sub GetStatistics($;$) my $Tasks = $Step->Tasks; foreach my $Task (@{$Tasks->GetItems()}) { - $GlobalStats->{"newtasks.count"}++ if ($CountsAsNew); - + my $HostStats; + if ($VMs->ItemExists($Task->VM->GetKey())) + { + my $Host = $Task->VM->GetHost(); + $HostStats = ($HostsStats->{items}->{$Host} ||= {}); + } + if ($CountsAsNew) + { + $GlobalStats->{"newtasks.count"}++; + $HostStats->{"newtasks.count"}++ if ($HostStats); + } next if (!$Task->Ended or $Task->Ended < $Cutoff); $GlobalStats->{"donetasks.count"}++; + $HostStats->{"donetasks.count"}++ if ($HostStats);
# $Task->Started should really be set since $Task->Ended is if ($Task->Started and $Task->Status !~ /^(?:queued|running|canceled)$/) diff --git a/testbot/web/Stats.pl b/testbot/web/Stats.pl index 51a72278e..806a3666c 100644 --- a/testbot/web/Stats.pl +++ b/testbot/web/Stats.pl @@ -264,15 +264,15 @@ sub GenerateBody($) print "<th>$DisplayHost</th>\n";
_AddRate($HostsStats->{items}->{$Host}, "reverting.time.count", $HostsStats); - _AddRate($HostsStats->{items}->{$Host}, "running.time.count", $HostsStats); + _AddRate($HostsStats->{items}->{$Host}, "newtasks.count", $HostsStats); } print "</tr></thead>\n";
print "<tbody>\n"; _GenStatsLine($HostsStats, "reverting.time.count", "Revert count", $SortedHosts); _GenStatsLine($HostsStats, "reverting.rate", "Revert rate", $SortedHosts); - _GenStatsLine($HostsStats, "running.time.count", "Task count", $SortedHosts); - _GenStatsLine($HostsStats, "running.rate", "Task rate", $SortedHosts); + _GenStatsLine($HostsStats, "newtasks.count", "Task count", $SortedHosts); + _GenStatsLine($HostsStats, "newtasks.rate", "Task rate", $SortedHosts); _GenStatsLine($HostsStats, "busy.elapsed", "Busy time", $SortedHosts, $NO_PERCENTAGE); _GenStatsLine($HostsStats, "busy.elapsed", "Busy %", $SortedHosts);