Module: tools Branch: master Commit: 6e8fd898fef19fde281f78353a31bef84886bc05 URL: https://source.winehq.org/git/tools.git/?a=commit;h=6e8fd898fef19fde281f7835...
Author: Francois Gouget fgouget@codeweavers.com Date: Mon Feb 12 01:34:25 2018 +0100
testbot: Explicitly track new tasks on a per VM host basis.
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 Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 c76b21e..3016b14 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 51a7227..806a366 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);