[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [OSSTEST PATCH] ms-flights-summary: Improve the overview table



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@xxxxxxxxxxxxx>

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

> ---
> Â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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.