Module: tools
Branch: master
Commit: 31ba0abf4f232c8dd174824c469408634d459ba4
URL: https://source.winehq.org/git/tools.git/?a=commit;h=31ba0abf4f232c8dd174824…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Feb 8 12:10:03 2018 +0100
testbot: Don't include incomplete VM operations in statistics.
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(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
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 c04a1e4..5122dc3 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;
Module: tools
Branch: master
Commit: 0d8799b58d9d22eaa4ee48c474d5fc7949b0f36a
URL: https://source.winehq.org/git/tools.git/?a=commit;h=0d8799b58d9d22eaa4ee48c…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Feb 8 12:09:53 2018 +0100
testbot: Fix the duration of some VM operations.
Sometimes a RecordGroup containing VM status information is followed by
a RecordGroup containing only VM result information. This typically
happens when a VM is running a task which ends in the 'boterror' state.
However this VM result RecordGroup does not mean the VM is no longer in
the 'running' state so it should not be used to set the previous
group's 'end' time.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/Activity.pm | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm
index 5d8ee5f..c04a1e4 100644
--- a/testbot/lib/WineTestBot/Activity.pm
+++ b/testbot/lib/WineTestBot/Activity.pm
@@ -226,19 +226,25 @@ sub GetActivity($;$)
{
my $StatusVMs = $Group->{statusvms};
my $ResultVMs = $Group->{resultvms};
- next if (!$StatusVMs and !$ResultVMs);
- if ($LastGroup)
+ if ($StatusVMs)
{
- $LastGroup->{end} = $Group->{start};
- foreach my $Counter ('runnable', 'queued')
+ if ($LastGroup)
{
- if (!exists $Group->{$Counter} and exists $LastGroup->{$Counter})
+ $LastGroup->{end} = $Group->{start};
+ foreach my $Counter ('runnable', 'queued')
{
- $Group->{$Counter} = $LastGroup->{$Counter};
+ if (!exists $Group->{$Counter} and exists $LastGroup->{$Counter})
+ {
+ $Group->{$Counter} = $LastGroup->{$Counter};
+ }
}
}
+ $LastGroup = $Group;
+ }
+ elsif (!$ResultVMs)
+ {
+ next;
}
- $LastGroup = $Group;
foreach my $VM (@{$VMs->GetItems()})
{
Module: tools
Branch: master
Commit: 2939680d831e6fd954a7455faf38c32a9405acec
URL: https://source.winehq.org/git/tools.git/?a=commit;h=2939680d831e6fd954a7455…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Feb 8 12:09:44 2018 +0100
testbot: Fix the activity start and end times.
Even if the last job completed hours ago, the period covered by the data
we have in the jobs table always goes all the way up to now. Also it
starts with when the oldest job on record was submitted, whether that
job completed successfully or not.
Similarly the data in our activity records always covers everything up
until the present.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/Activity.pm | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm
index 8c22e01..5d8ee5f 100644
--- a/testbot/lib/WineTestBot/Activity.pm
+++ b/testbot/lib/WineTestBot/Activity.pm
@@ -43,11 +43,6 @@ sub _UpdateMin($$)
$_[0] = $_[1] if (!defined $_[0] or $_[1] < $_[0]);
}
-sub _UpdateMax($$)
-{
- $_[0] = $_[1] if (!defined $_[0] or $_[0] < $_[1]);
-}
-
=pod
=over 12
@@ -345,6 +340,7 @@ sub GetStatistics($)
foreach my $Job (@{$Jobs->GetItems()})
{
$GlobalStats->{"jobs.count"}++;
+ _UpdateMin($GlobalStats->{start}, $Job->Submitted);
my $IsSpecialJob;
my $Steps = $Job->Steps;
@@ -386,9 +382,6 @@ sub GetStatistics($)
my $Time = $Job->Ended - $Job->Submitted;
_AddFullStat($GlobalStats, "jobs.time", $Time, undef, $Job);
push @JobTimes, $Time;
-
- _UpdateMin($GlobalStats->{start}, $Job->Submitted);
- _UpdateMax($GlobalStats->{end}, $Job->Ended);
}
}
@@ -408,7 +401,6 @@ sub GetStatistics($)
foreach my $Group (@$Activity)
{
_UpdateMin($VMsStats->{start}, $Group->{start});
- _UpdateMax($VMsStats->{end}, $Group->{end});
next if (!$Group->{statusvms});
my ($IsGroupBusy, %IsHostBusy);
@@ -464,6 +456,9 @@ sub GetStatistics($)
$GlobalStats->{"busy.elapsed"} += $Group->{end} - $Group->{start};
}
}
+
+ # The end is now!
+ $GlobalStats->{end} = $VMsStats->{end} = $Counters->{now};
$GlobalStats->{elapsed} = $GlobalStats->{end} - $GlobalStats->{start};
$HostsStats->{elapsed} =
$VMsStats->{elapsed} = $VMsStats->{end} - $VMsStats->{start};