Module: tools
Branch: master
Commit: 8f4e6c03f9aae9312d18ce0347995442946fc355
URL: https://source.winehq.org/git/tools.git/?a=commit;h=8f4e6c03f9aae9312d18ce0…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Apr 14 16:57:57 2022 +0200
testbot: Filter the jobs in GetStatistics().
This reduces the number of Tasks that need to be loaded from the
database and processed in order to collect the statistics for short
periods of time.
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, 7 insertions(+), 1 deletion(-)
diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm
index f757905..d395a12 100644
--- a/testbot/lib/WineTestBot/Activity.pm
+++ b/testbot/lib/WineTestBot/Activity.pm
@@ -31,6 +31,8 @@ our @EXPORT = qw(GetActivity GetStatistics);
use List::Util qw(max);
use Scalar::Util qw(weaken);
+use ObjectModel::Collection;
+
use WineTestBot::Config;
use WineTestBot::Jobs;
use WineTestBot::RecordGroups;
@@ -342,9 +344,12 @@ sub GetStatistics($;$)
my ($GlobalStats, $HostsStats, $VMsStats) = ({}, {}, {});
- my @JobTimes;
my $Jobs = CreateJobs();
my $Cutoff = $Seconds ? (time() - $Seconds) : 0;
+ $Jobs->AddFilter(FilterOr(FilterNull("Ended"),
+ FilterValue("Ended", ">=", [$Cutoff])));
+
+ my @JobTimes;
foreach my $Job (@{$Jobs->GetItems()})
{
my $CountsAsNew = ($Job->Submitted >= $Cutoff);
@@ -372,6 +377,7 @@ sub GetStatistics($;$)
$GlobalStats->{"newtasks.count"}++;
$HostStats->{"newtasks.count"}++ if ($HostStats);
}
+ # The Task may have ended much earlier than the Job
next if (!$Task->Ended or $Task->Ended < $Cutoff);
$GlobalStats->{"donetasks.count"}++;
$HostStats->{"donetasks.count"}++ if ($HostStats);
Module: tools
Branch: master
Commit: 892646b54fc9a747bedd992a9b816610fb01bfd1
URL: https://source.winehq.org/git/tools.git/?a=commit;h=892646b54fc9a747bedd992…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Apr 14 16:57:20 2022 +0200
testbot/web: Show all the job.time percentiles.
And add a bar graph to give a better sense of how the job durations
stack up.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/web/Stats.pl | 13 +++++++++----
testbot/web/WineTestBot.css | 2 ++
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/testbot/web/Stats.pl b/testbot/web/Stats.pl
index 7ef65b3..3c0fe99 100644
--- a/testbot/web/Stats.pl
+++ b/testbot/web/Stats.pl
@@ -223,10 +223,15 @@ sub GenerateBody($)
_GenGlobalLine($GlobalStats, "busy.elapsed", "Busy \%", "The percentage of wall clock time where the TestBot was busy running jobs.");
print "<tr><td class='StatSeparator'>Job times</td><td colspan='2'><hr></td></tr>\n";
- _GenGlobalLine($GlobalStats, "jobs.time.p10", "10%", "10% of the jobs completed within this time.");
- _GenGlobalLine($GlobalStats, "jobs.time.p50", "50%", "50% of the jobs completed within this time.");
- _GenGlobalLine($GlobalStats, "jobs.time.p90", "90%", "90% of the jobs completed within this time.");
- _GenGlobalLine($GlobalStats, "jobs.time.max", "Max", "The slowest job took this long. Note that this is heavily influenced by test storms.");
+ my $Max = $GlobalStats->{"jobs.time.max"};
+ for (my $Percentile = 10; $Percentile < 100; $Percentile += 10)
+ {
+ my $Bar = 100 * $GlobalStats->{"jobs.time.p$Percentile"} / $Max;
+ my $Space = 100 - $Bar;
+ _GenGlobalLine($GlobalStats, "jobs.time.p$Percentile", "$Percentile%",
+ "<div class='PercentBar' style='width: ${Bar}px;'> </div><div class='PercentSpace' style='width: ${Space}px;'></div> $Percentile% of the jobs completed within this time.");
+ }
+ _GenGlobalLine($GlobalStats, "jobs.time.max", "Max", "<div class='PercentBar' style='width: 100px;'> </div> Duration of the slowest job. Note that this is heavily influenced by test storms.");
print "<tr><td class='StatSeparator'>Average times</td><td colspan='2'><hr></td></tr>\n";
_GenGlobalLine($GlobalStats, "jobs.time", "Job completion", "How long it takes to complete a regular job (excluding canceled ones). Note that this is heavily influenced by test storms.");
diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css
index 301ba71..53c939e 100644
--- a/testbot/web/WineTestBot.css
+++ b/testbot/web/WineTestBot.css
@@ -445,3 +445,5 @@ td.Record { text-align: center; }
.Record.Record-miss { border-top: thick dashed #ff6600; }
td.StatSeparator { color: #601919; font-weight: bold; }
+.PercentBar { background-color: #601919; display: inline-block; }
+.PercentSpace { display: inline-block; }