Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/lib/WineTestBot/Activity.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm index 53aff0582..f7579057e 100644 --- a/testbot/lib/WineTestBot/Activity.pm +++ b/testbot/lib/WineTestBot/Activity.pm @@ -415,9 +415,11 @@ sub GetStatistics($;$) if ($JobCount) { @JobTimes = sort { $a <=> $b } @JobTimes; - $GlobalStats->{"jobs.time.p10"} = $JobTimes[int($JobCount * 0.1)]; - $GlobalStats->{"jobs.time.p50"} = $JobTimes[int($JobCount * 0.5)]; - $GlobalStats->{"jobs.time.p90"} = $JobTimes[int($JobCount * 0.9)]; + for (my $P = 10; $P < 100; $P += 10) + { + my $Name = sprintf("jobs.time.p%02d", $P); + $GlobalStats->{$Name} = $JobTimes[int($JobCount * $P / 100)]; + } @JobTimes = (); # free early }
And add a bar graph to give a better sense of how the job durations stack up.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- The stats page's small barchart only has 10 values and I may be comparing apples and oranges but at first glance I think the shape on my box matches what queuing theory would predict for a fairly loaded system (the more loaded the more curvy). It probably makes sense too. And I suspect the result will be pretty similar on the TestBot. --- 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 7ef65b3bf..3c0fe9990 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 301ba71df..53c939efd 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; }