User: knarf Date: 2011/04/05 04:08 PM
Modified: /release-info/ parse_testsuite_results.cgi, parse_testsuite_results.php
Log: reduce table size
File Changes:
Directory: /release-info/ =========================
File [modified]: parse_testsuite_results.cgi Delta lines: +86 -59 =================================================================== --- release-info/parse_testsuite_results.cgi 2011-04-05 20:36:44 UTC (rev 498) +++ release-info/parse_testsuite_results.cgi 2011-04-05 21:08:38 UTC (rev 499) @@ -6,6 +6,9 @@ #my $query = new CGI; #print $query->header(-charset=>'utf-8');
+my $ignore; +if (!defined($ARGV[0])) { $ignore = "(1,2)|(2,1)"; } + # get list of log files my @filenames = (); opendir(DIR, ".") || die "cannot open dir: $!"; @@ -113,7 +116,8 @@ foreach my $host (sort(keys(%allhosts))) { my $ncols = 0; foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { - foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { $ncols++; } } + foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { + if (!defined($ignore) or "$nprocs,$nthreads" !~ /$ignore/) { $ncols++; } } } $table_entries .= "<th colspan='$ncols'>$host</th>"; } # host table headings @@ -121,9 +125,10 @@ foreach my $host (sort(keys(%allhosts))) { foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { - my $color = " style="background-color:#d0d0d0;""; - if ($nprocs != "1") { $color = " style="background-color:#e0e0e0;""; } - $table_entries .= "<th$color>${nprocs}p, ${nthreads}t</th>"; + if (!defined($ignore) or "$nprocs,$nthreads" !~ /$ignore/) + { + $table_entries .= "<th class='c".(($nprocs=="1")?1:2)."'>${nprocs}p, ${nthreads}t</th>"; + } } } } @@ -139,33 +144,36 @@ foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { # color handling - my $color = " style="background-color:#d0d0d0;""; - my $green = (Date_Cmp($fileinfo{$host}{$nprocs}{$nthreads}{"time"}, $too_old) > 0) ? "00FF00":"000000"; + my $green = (Date_Cmp($fileinfo{$host}{$nprocs}{$nthreads}{"time"}, $too_old) > 0) ? "g":""; my $red = (Date_Cmp($fileinfo{$host}{$nprocs}{$nthreads}{"time"}, $too_old) > 0) ? "FF0000":"000000"; - if ($nprocs != "1") { $color = " style="background-color:#e0e0e0;""; } + my $bg = 1; + if ($nprocs != "1") { $bg = 2;} # - if (defined($results{$thorn}{$test}{$host}) and - defined($results{$thorn}{$test}{$host}{$nprocs}) and - defined($results{$thorn}{$test}{$host}{$nprocs}{$nthreads})) { - $allhosts{$host}{$nprocs}{$nthreads}{"ran"}++; - if ($results{$thorn}{$test}{$host}{$nprocs}{$nthreads}{"result"} =~ /Success/) { - $allhosts{$host}{$nprocs}{$nthreads}{"success"}++; - $table_entries .= "<td$color align='center'><font color='#$green'>â</font></td>"; + if (!defined($ignore) or "$nprocs,$nthreads" !~ /$ignore/) + { + if (defined($results{$thorn}{$test}{$host}) and + defined($results{$thorn}{$test}{$host}{$nprocs}) and + defined($results{$thorn}{$test}{$host}{$nprocs}{$nthreads})) { + $allhosts{$host}{$nprocs}{$nthreads}{"ran"}++; + if ($results{$thorn}{$test}{$host}{$nprocs}{$nthreads}{"result"} =~ /Success/) { + $allhosts{$host}{$nprocs}{$nthreads}{"success"}++; + $table_entries .= "<td class='c$bg$green'>â</td>"; + } else { + $allhosts{$host}{$nprocs}{$nthreads}{"fail"}++; + my $details = $results{$thorn}{$test}{$host}{$nprocs}{$nthreads}{"details"}; + my $entry = "<b>$details</b>"; + if ($details =~ /(\d+) files compared, (\d+) differ, (\d+) differ significantly/) { + $entry = "<font color='#$red'><b>$3</b></font>/$1"; + } + if ($details =~ /(\d+) files missing, (\d+) files compared, (\d+) differ/) { + $entry = "<font color='#$red'><b>$1</b></font> missing, ". + "<font color='#$red'><b>$3</b></font>/$2"; + } + $table_entries .= "<td class='c$bg'>$entry</td>"; + } } else { - $allhosts{$host}{$nprocs}{$nthreads}{"fail"}++; - my $details = $results{$thorn}{$test}{$host}{$nprocs}{$nthreads}{"details"}; - my $entry = "<b>$details</b>"; - if ($details =~ /(\d+) files compared, (\d+) differ, (\d+) differ significantly/) { - $entry = "<font color='#$red'><b>$3</b></font>/$1"; - } - if ($details =~ /(\d+) files missing, (\d+) files compared, (\d+) differ/) { - $entry = "<font color='#$red'><b>$1</b></font> missing, ". - "<font color='#$red'><b>$3</b></font>/$2"; - } - $table_entries .= "<td$color align='center'>$entry</td>"; + $table_entries .= "<td class='c$bg'> </td>"; } - } else { - $table_entries .= "<td$color> </td>"; } } } @@ -179,16 +187,18 @@ foreach my $host (sort(keys(%allhosts))) { my $ncols = 0; foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { - foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { $ncols++; } } + foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { + if (!defined($ignore) or "$nprocs,$nthreads" !~ /$ignore/) { $ncols++; } } } $table_entries_h .= "<th colspan='$ncols'>$host</th>"; } $table_entries_h .= "</tr>\n<tr>"; foreach my $host (sort(keys(%allhosts))) { foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { - my $color = " style="background-color:#d0d0d0;""; - if ($nprocs != "1") { $color = " style="background-color:#e0e0e0;""; } - $table_entries_h .= "<th$color>${nprocs}p, ${nthreads}t</th>"; + if (!defined($ignore) or "$nprocs,$nthreads" !~ /$ignore/) + { + $table_entries_h .= "<th class='c".(($nprocs=="1")?1:2)."'>${nprocs}p, ${nthreads}t</th>"; + } } } } @@ -196,17 +206,21 @@ foreach my $host (sort(keys(%allhosts))) { foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { - my $color = " style="background-color:#d0d0d0;""; - if ($nprocs != "1") { $color = " style="background-color:#e0e0e0;""; } - $table_entries_h .= "<td$color align='center'>"; - if (defined($fileinfo{$host}) and defined($fileinfo{$host}{$nprocs}) and - defined($fileinfo{$host}{$nprocs}{$nthreads}) and - defined($fileinfo{$host}{$nprocs}{$nthreads}{"time"}) and - defined($fileinfo{$host}{$nprocs}{$nthreads}{"user"})) { - $table_entries_h .= $fileinfo{$host}{$nprocs}{$nthreads}{"user"}."<br/>". - UnixDate($fileinfo{$host}{$nprocs}{$nthreads}{"time"}, "%m/%d"); - } else { $table_entries_h .= " "; } - $table_entries_h .= "</td>"; + if (!defined($ignore) or "$nprocs,$nthreads" !~ /$ignore/) + { + $table_entries_h .= "<td class='c".(($nprocs=="1")?1:2)."'>"; + if (!defined($ignore) or "$nprocs,$nthreads" !~ /$ignore/) + { + if (defined($fileinfo{$host}) and defined($fileinfo{$host}{$nprocs}) and + defined($fileinfo{$host}{$nprocs}{$nthreads}) and + defined($fileinfo{$host}{$nprocs}{$nthreads}{"time"}) and + defined($fileinfo{$host}{$nprocs}{$nthreads}{"user"})) { + $table_entries_h .= $fileinfo{$host}{$nprocs}{$nthreads}{"user"}."<br/>". + UnixDate($fileinfo{$host}{$nprocs}{$nthreads}{"time"}, "%m/%d"); + } else { $table_entries_h .= " "; } + } + $table_entries_h .= "</td>"; + } } } } @@ -214,10 +228,11 @@ foreach my $host (sort(keys(%allhosts))) { foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { - my $color = " style="background-color:#d0d0d0;""; - if ($nprocs != "1") { $color = " style="background-color:#e0e0e0;""; } - $table_entries_h .= "<td$color align='center'><b>".$allhosts{$host}{$nprocs}{$nthreads}{"fail"}."</b>/". - $allhosts{$host}{$nprocs}{$nthreads}{"ran"}."</td>"; + if (!defined($ignore) or "$nprocs,$nthreads" !~ /$ignore/) + { + $table_entries_h .= "<td class='c".(($nprocs=="1")?1:2)."'><b>".$allhosts{$host}{$nprocs}{$nthreads}{"fail"}."</b>/". + $allhosts{$host}{$nprocs}{$nthreads}{"ran"}."</td>"; + } } } } @@ -225,12 +240,13 @@ foreach my $host (sort(keys(%allhosts))) { foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { - my $color = " style="background-color:#d0d0d0;""; - my $png = (Date_Cmp($fileinfo{$host}{$nprocs}{$nthreads}{"time"}, $too_old) > 0) ? "red":"dark"; - if ($nprocs != "1") { $color = " style="background-color:#e0e0e0;""; } - $table_entries_h .= "<td$color align='center' valign='bottom'>". - "<img src='$png.png' alt='fail' width='20px' height='". - $allhosts{$host}{$nprocs}{$nthreads}{"fail"}."px'/></td>\n"; + if (!defined($ignore) or "$nprocs,$nthreads" !~ /$ignore/) + { + my $png = (Date_Cmp($fileinfo{$host}{$nprocs}{$nthreads}{"time"}, $too_old) > 0) ? "red":"dark"; + $table_entries_h .= "<td class='c".(($nprocs=="1")?1:2)."' valign='bottom'>". + "<img src='$png.png' alt='fail' width='20px' height='". + $allhosts{$host}{$nprocs}{$nthreads}{"fail"}."px'/></td>\n"; + } } } } @@ -238,12 +254,13 @@ foreach my $host (sort(keys(%allhosts))) { foreach my $nprocs (sort(keys(%{$allhosts{$host}}))) { foreach my $nthreads (sort(keys(%{$allhosts{$host}{$nprocs}}))) { - my $color = " style="background-color:#d0d0d0;""; - my $png = (Date_Cmp($fileinfo{$host}{$nprocs}{$nthreads}{"time"}, $too_old) > 0) ? "green":"bright"; - if ($nprocs != "1") { $color = " style="background-color:#e0e0e0;""; } - $table_entries_h .= "<td$color align='center' valign='top'>". - "<img src='$png.png' alt='success' width='20px' height='". - $allhosts{$host}{$nprocs}{$nthreads}{"success"}."px'/></td>\n"; + if (!defined($ignore) or "$nprocs,$nthreads" !~ /$ignore/) + { + my $png = (Date_Cmp($fileinfo{$host}{$nprocs}{$nthreads}{"time"}, $too_old) > 0) ? "green":"bright"; + $table_entries_h .= "<td class='c".(($nprocs=="1")?1:2)."' valign='top'>". + "<img src='$png.png' alt='success' width='20px' height='". + $allhosts{$host}{$nprocs}{$nthreads}{"success"}."px'/></td>\n"; + } } } } @@ -251,6 +268,16 @@
$table_entries = $table_entries_h . $table_entries;
-print '<style type="text/css"> th, td {padding: 0em;}</style>'."\n"; +print <<CSS; +<style type="text/css"> + th, td {padding: 0em;} + th.c1 { background-color: #d0d0d0; text-align: center; } + th.c2 { background-color: #e0e0e0; text-align: center; } + td.c1 { background-color: #d0d0d0; text-align: center; } + td.c2 { background-color: #e0e0e0; text-align: center; } + td.c1g { background-color: #d0d0d0; text-align: center; color: #00FF00;} + td.c2g { background-color: #e0e0e0; text-align: center; color: #00FF00;} +</style> +CSS
print "<table border='1'>$table_entries</table>\n";
File [modified]: parse_testsuite_results.php Delta lines: +3 -1 =================================================================== --- release-info/parse_testsuite_results.php 2011-04-05 20:36:44 UTC (rev 498) +++ release-info/parse_testsuite_results.php 2011-04-05 21:08:38 UTC (rev 499) @@ -2,8 +2,10 @@ $hide_path=1; include_once($_SERVER['DOCUMENT_ROOT'].'/global/header.php');
-exec('./parse_testsuite_results.cgi', $output); +$show_all = $_GET['show_all'] ? "1":"";
+exec('./parse_testsuite_results.cgi $show_all', $output); + foreach ($output as $line) { echo $line."\n"; }
commits@lists.einsteintoolkit.org