Including a revert operation that started a couple of seconds ago but has not yet completed in the average revert time would distort the result (particularly if restricting the analysis to the recent past).
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/lib/WineTestBot/Activity.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm index c04a1e437..5122dc36f 100644 --- a/testbot/lib/WineTestBot/Activity.pm +++ b/testbot/lib/WineTestBot/Activity.pm @@ -311,6 +311,7 @@ sub GetActivity($;$) my $LastVMStatus = $LastStatusVMs{$VM->Name}->{$VM->Name}; next if (!$LastVMStatus); $LastVMStatus->{end} = $Counters->{now}; + $LastVMStatus->{ongoing} = 1; if ($LastVMStatus->{status} eq "unknown") { $LastVMStatus->{status} = $VM->Status; @@ -422,8 +423,11 @@ sub GetStatistics($) my $Status = $VMStatus->{status};
my $Time = $VMStatus->{end} - $VMStatus->{start}; - _AddFullStat($VMStats, "$Status.time", $Time, $Group->{id}); - _AddFullStat($HostStats, "$Status.time", $Time, $Group->{id}); + if (!$VMStatus->{ongoing}) + { + _AddFullStat($VMStats, "$Status.time", $Time, $Group->{id}); + _AddFullStat($HostStats, "$Status.time", $Time, $Group->{id}); + } if ($Status =~ /^(?:reverting|sleeping|running|dirty)$/) { $VMStats->{"busy.elapsed"} += $Time;