All of lore.kernel.org
 help / color / mirror / Atom feed
* [OSSTEST PATCH] ms-flights-summary: Improve the overview table
@ 2015-11-17 11:55 Ian Jackson
  2015-11-17 12:06 ` Ian Campbell
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Jackson @ 2015-11-17 11:55 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

- Align the queued/preparing/running/etc. totals into table columns.
- Use <strong> to highlight `queued' jobs.
- Use <strong> to highlight the end time if it is the flight end,
  not just a phase end.
- No longer print the `total unqueued' separately.
- Show the `common info'.

Replace much of the HTML generation with plain literal or
almost-literal HTML, since the HTML is complex to generate but easy to
write.

An example of the output can be seen here:
   http://xenbits.xen.org/people/iwj/2015/flights-summary.html

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 ms-flights-summary |   52 +++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 41 insertions(+), 11 deletions(-)

diff --git a/ms-flights-summary b/ms-flights-summary
index fb03a26..ec8fa18 100755
--- a/ms-flights-summary
+++ b/ms-flights-summary
@@ -355,12 +355,36 @@ printf("<p>%d flight(s) consisting of %s job(s)<br />%s<br />%s anonymous/rogue
        join(" + ", map { "$global_stats{$_} $_" } (sort_stats(\%global_stats))),
        scalar keys %anon_jobs);
 
-printf("<table border='0' cellspacing='0' rules=all>\n");
-printf("<tr bgcolor=#808080>\n");
-printf("  <th align=left>$_</th>\n") foreach ("Flight", "Branch", "Blessing",
-				   "(Active+Complete)/Total Jobs", "Counts",
-				   "End of current phase");
-printf("</tr>\n");
+my %summarycounts;
+foreach my $fi (values %flights) {
+    $summarycounts{$_} += $fi->{Stats}{$_} foreach (keys \%{ $fi->{Stats} });
+}
+my @summarycounts = sort_stats \%summarycounts;
+
+printf <<END, (@summarycounts + 1);
+<table border='0' cellspacing='0' rules=all>
+ <tr bgcolor=#808080>
+  <th align=left>Flight</th>
+  <th align=left>Branch</th>
+  <th align=left>Blessing</th>
+  <th align=left colspan=%d>Job counts</th>
+  <th align=left>End of phase/flight</th>
+  <th align=left>Common info</th>
+ </tr>
+ <tr bgcolor=#808080>
+  <th></th>
+  <th></th>
+  <th></th>
+  <th>Total</th>
+END
+
+print("  <th align=right>$_</th>\n") foreach @summarycounts;
+
+print <<END;
+  <th></th>
+  <th align=left>(active jobs only)</th>
+ </tr>
+END
 
 my $alt = 0;
 foreach my $f (sort keys %flights) {
@@ -372,11 +396,17 @@ foreach my $f (sort keys %flights) {
     print "  <td><a href=\"#$f\">$f</a></td>\n";
     print "  <td>$fi->{Branch}</td>\n";
     print "  <td>$fi->{Intended}</td>\n";
-    print "  <td>$fi->{UnqueuedJobs}/$fi->{NrJobs}</td>\n";
-    print "  <td>".
-	join(" + ", map { "$fi->{Stats}{$_} $_" } (sort_stats(\%{$fi->{Stats}})))
-	."</td>\n";
-    print "  <td>".fmttime($fi->{ExpectedEnd})."</td>\n";
+    print "  <td align=right><strong>$fi->{NrJobs}</strong></td>\n";
+    foreach (@summarycounts) {
+	my $s = ($fi->{Stats}{$_} || '');
+	$s = "<strong>$s</strong>" if $s && $_ eq 'queued';
+	print "  <td align=right>$s</td>";
+    }
+    my $expectedend = fmttime($fi->{ExpectedEnd});
+    $expectedend = "<strong>$expectedend</strong>"
+	if $fi->{UnqueuedJobs} == $fi->{NrJobs};
+    print "  <td>$expectedend</td>\n";
+    print "  <td>".($fi->{Info} || '')."</td>\n";
     print "</tr>\n";
     $alt ^= 1;
 }
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [OSSTEST PATCH] ms-flights-summary: Improve the overview table
  2015-11-17 11:55 [OSSTEST PATCH] ms-flights-summary: Improve the overview table Ian Jackson
@ 2015-11-17 12:06 ` Ian Campbell
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2015-11-17 12:06 UTC (permalink / raw)
  To: Ian Jackson, xen-devel

On Tue, 2015-11-17 at 11:55 +0000, Ian Jackson wrote:
> - Align the queued/preparing/running/etc. totals into table columns.
> - Use <strong> to highlight `queued' jobs.
> - Use <strong> to highlight the end time if it is the flight end,
>   not just a phase end.
> - No longer print the `total unqueued' separately.
> - Show the `common info'.
> 
> Replace much of the HTML generation with plain literal or
> almost-literal HTML, since the HTML is complex to generate but easy to
> write.
> 
> An example of the output can be seen here:
>    http://xenbits.xen.org/people/iwj/2015/flights-summary.html
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  ms-flights-summary |   52 +++++++++++++++++++++++++++++++++++++++++-----
> ------
>  1 file changed, 41 insertions(+), 11 deletions(-)
> 
> diff --git a/ms-flights-summary b/ms-flights-summary
> index fb03a26..ec8fa18 100755
> --- a/ms-flights-summary
> +++ b/ms-flights-summary
> @@ -355,12 +355,36 @@ printf("<p>%d flight(s) consisting of %s job(s)<br
> />%s<br />%s anonymous/rogue
>         join(" + ", map { "$global_stats{$_} $_" }
> (sort_stats(\%global_stats))),
>         scalar keys %anon_jobs);
>  
> -printf("<table border='0' cellspacing='0' rules=all>\n");
> -printf("<tr bgcolor=#808080>\n");
> -printf("  <th align=left>$_</th>\n") foreach ("Flight", "Branch",
> "Blessing",
> -				   "(Active+Complete)/Total Jobs",
> "Counts",
> -				   "End of current phase");
> -printf("</tr>\n");
> +my %summarycounts;
> +foreach my $fi (values %flights) {
> +    $summarycounts{$_} += $fi->{Stats}{$_} foreach (keys \%{ $fi-
> >{Stats} });
> +}
> +my @summarycounts = sort_stats \%summarycounts;
> +
> +printf <<END, (@summarycounts + 1);
> +<table border='0' cellspacing='0' rules=all>
> + <tr bgcolor=#808080>
> +  <th align=left>Flight</th>
> +  <th align=left>Branch</th>
> +  <th align=left>Blessing</th>
> +  <th align=left colspan=%d>Job counts</th>
> +  <th align=left>End of phase/flight</th>
> +  <th align=left>Common info</th>
> + </tr>
> + <tr bgcolor=#808080>
> +  <th></th>
> +  <th></th>
> +  <th></th>
> +  <th>Total</th>
> +END
> +
> +print("  <th align=right>$_</th>\n") foreach @summarycounts;
> +
> +print <<END;
> +  <th></th>
> +  <th align=left>(active jobs only)</th>
> + </tr>
> +END
>  
>  my $alt = 0;
>  foreach my $f (sort keys %flights) {
> @@ -372,11 +396,17 @@ foreach my $f (sort keys %flights) {
>      print "  <td><a href=\"#$f\">$f</a></td>\n";
>      print "  <td>$fi->{Branch}</td>\n";
>      print "  <td>$fi->{Intended}</td>\n";
> -    print "  <td>$fi->{UnqueuedJobs}/$fi->{NrJobs}</td>\n";
> -    print "  <td>".
> -	join(" + ", map { "$fi->{Stats}{$_} $_" } (sort_stats(\%{$fi-
> >{Stats}})))
> -	."</td>\n";
> -    print "  <td>".fmttime($fi->{ExpectedEnd})."</td>\n";
> +    print "  <td align=right><strong>$fi->{NrJobs}</strong></td>\n";
> +    foreach (@summarycounts) {
> +	my $s = ($fi->{Stats}{$_} || '');
> +	$s = "<strong>$s</strong>" if $s && $_ eq 'queued';
> +	print "  <td align=right>$s</td>";
> +    }
> +    my $expectedend = fmttime($fi->{ExpectedEnd});
> +    $expectedend = "<strong>$expectedend</strong>"
> +	if $fi->{UnqueuedJobs} == $fi->{NrJobs};
> +    print "  <td>$expectedend</td>\n";
> +    print "  <td>".($fi->{Info} || '')."</td>\n";
>      print "</tr>\n";
>      $alt ^= 1;
>  }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-17 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-17 11:55 [OSSTEST PATCH] ms-flights-summary: Improve the overview table Ian Jackson
2015-11-17 12:06 ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.