Changeset 350

Show
Ignore:
Timestamp:
12/10/06 18:57:46 (6 years ago)
Author:
max
Message:

Completed migration to template system; haven't altered any actual stats or graphs yet

Location:
util
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • util/server_daily_maint

    r341 r350  
    809809                &graph_count_data($template, 'GRAPHS_OVERALL', 24,21,12,24, "c_".$c."_success_counter", "c_".$c."_fail_counter"); 
    810810 
    811                 my @sf; 
    812                 foreach my $w ("success", "fail")  
     811                my @sf;  
     812                foreach my $w ("success", "failure")  
    813813                { 
    814814                        my $h; 
    815                         $h->{'NAME'} = $w; 
     815                        $h->{NAME} = $w; 
    816816 
    817817                        my $g = "c_".$c."_".$w; 
    818818 
    819                         my (@timeslices, @versions); 
     819                        my @timeslices; 
    820820                        foreach my $timeslice ("day", "month") 
    821821                        { 
     822                            my @versions; 
    822823                            foreach my $c  
    823824                            ( 
     
    825826                                keys %{($store->{"per_$timeslice"}->[0]->{$g."_version_list"})}) { 
    826827                                    my $val = $store->{"per_$timeslice"}->[0]->{$g."_version_list"}->{$c}; 
    827                                     push @versions, { TIMES => sprintf("%d time%s", $val, ($val != 1 ? "s" : "")), 
    828                                             VERSION => $c }; 
     828                                    my $h2; 
     829                                    $h2->{'TIMES'} = sprintf("%d time%s", $val, ($val != 1 ? "s" : "")); 
     830                                    $h2->{'VERSION'} = $c; 
     831                                    push @versions, $h2; 
    829832                            } 
    830833                            push @timeslices, { TIMESLICE => $timeslice, VERSIONS => \@versions }; 
    831834                        } 
    832                         push @sf, { SFV_TIMESLICES => \@timeslices }; 
     835                        $h->{'SFV_TIMESLICES'} = \@timeslices; 
    833836 
    834837                        my @durations = ( ); 
    835838                        foreach my $timeslice ("day", "month") 
    836839                        { 
    837                             if  ((defined $store->{per_month}->[0]->{$g."_duration_count"}) && ($store->{per_month}->[0]->{$g."_duration_count"} > 0)) 
     840                            if  ((defined $store->{"per_$timeslice"}->[0]->{$g."_duration_count"}) && ($store->{"per_$timeslice"}->[0]->{$g."_duration_count"} > 0)) 
    838841                            { 
    839842                                push @durations, { AVG => sec2hms(numvar($store->{"per_$timeslice"}->[0]->{$g."_duration"},"",0) / $store->{"per_$timeslice"}->[0]->{$g."_duration_count"}), 
     
    842845                            } 
    843846                        } 
    844                         push @sf, { DURATIONS => \@durations }; 
    845  
    846                         push @sf, { GRAPHS_DURATIONS => &graph_count_data(undef, undef, 24,21,12,24,$g."_duration", $g."_duration_min", $g."_duration_max") }; 
     847                        $h->{'DURATIONS'} = \@durations; 
     848 
     849                        $h->{'GRAPHS_DURATIONS'} = &graph_count_data(undef, undef, 24,21,12,24,$g."_duration", $g."_duration_min", $g."_duration_max"); 
     850                        push @sf, $h; 
    847851                } 
    848852                $template->param(SUCCESS_FAILURE => \@sf); 
     
    861865                            if ((defined $store->{"per_$timeslice"}->[0]->{$svar."_duration_count"}) && ($store->{"per_$timeslice"}->[0]->{$svar."_duration_count"} > 0)) 
    862866                            { 
    863                                 push @timeslices, { 'TIMESLICE' => $timeslice, 
    864                                                     'AVG' => numvar($store->{"per_$timeslice"}->[0]->{$svar."_duration"},"",0) / $store->{"per_$timeslice"}->[0]->{$svar."_duration_count"}, 
    865                                                     'MIN' => numvar($store->{"per_$timeslice"}->[0]->{$svar."_duration_min"},"",0), 
    866                                                     'MAX' => numvar($store->{"per_$timeslice"}->[0]->{$svar."_duration_max"},"",0) }; 
     867                                my $h; 
     868                                $h->{TIMESLICE} = $timeslice; 
     869                                $h->{AVG} = nformat(numvar($store->{"per_$timeslice"}->[0]->{$svar."_duration"},"",0) / $store->{"per_$timeslice"}->[0]->{$svar."_duration_count"}); 
     870                                $h->{MIN} = nformat(numvar($store->{"per_$timeslice"}->[0]->{$svar."_duration_min"},"",0)); 
     871                                $h->{MAX} = nformat(numvar($store->{"per_$timeslice"}->[0]->{$svar."_duration_max"},"",0)); 
     872                                push @timeslices, $h; 
    867873                            } 
    868874                        } 
    869                         push @statistics, { STATNAME => $sname, TIMESLICES => \@timeslices }; 
    870  
    871                         push @statistics, { GRAPHS_STATISTICS => &graph_count_data(undef, undef, 72,0,12,0,$svar."_duration", $svar."_duration_min", $svar."_duration_max")}; 
    872                 } 
     875                        push @statistics, { STATNAME => $sname, TIMESLICES => [ @timeslices ], GRAPHS_STATISTICS => &graph_count_data(undef, undef, 72,0,12,0,$svar."_duration", $svar."_duration_min", $svar."_duration_max")}; 
     876                } 
     877                #       print Dumper(\@statistics); 
    873878                $template->param(STATISTICS => \@statistics); 
    874879 
     
    879884} 
    880885 
    881 ############################################################################### 
    882  
    883  
     886sub nformat 
     887{ 
     888    my $n = shift; 
     889    return sprintf("%0.2f", $n); 
     890} 
     891 
     892############################################################################### 
     893 
     894 
  • util/server_daily_maint_component.tmpl

    r341 r350  
    2828</TMPL_LOOP> 
    2929<li><b>TOTAL SEEN: <u><TMPL_VAR NAME=COMPONENT_SUCCESS_RUNS_TOTAL></u></b></li> 
    30 <b>Failed runs:</b><br> 
     30<br><b>Failed runs:</b> <font color=lightblue><i>(blue)</i></font><br> 
    3131<TMPL_LOOP NAME=COMPONENT_FAIL_RUNS> 
    3232 <li>in last <TMPL_VAR NAME=TIMESLICE>: <b><TMPL_VAR NAME=SEEN></b> (previous <TMPL_VAR NAME=PREVIOUS>)</li> 
     
    5454  <h2>Duration (<TMPL_VAR NAME=NAME>)</h2> 
    5555  <b>How long <TMPL_VAR NAME=NAME> took to run (<TMPL_VAR NAME=NAME>):</b><br> 
    56   <TMPL_LOOP NAME=DURATION> 
     56  <TMPL_LOOP NAME=DURATIONS> 
    5757   <li><b>in last <TMPL_VAR NAME=TIMESLICE>:</b><br> 
    5858   &nbsp;&nbsp;&nbsp;Avg: <TMPL_VAR NAME=AVG> <i><font color=lightgreen>(green)</font></i><br> 
     
    6969</TMPL_LOOP> 
    7070 
     71</table><br><br> 
     72<h2>Grabber-specific statistics</h2> 
     73<table align=left> 
     74 
    7175<TMPL_LOOP NAME=STATISTICS> 
    7276 <tr><td align=left valign=top nowrap> 
    73  <h2<TMPL_VAR NAME=NAME> <TMPL_VAR NAME=STATNAME></h2> 
     77 <h2><TMPL_VAR NAME=STATNAME></h2> 
    7478 <TMPL_LOOP NAME=TIMESLICES> 
    7579  <li><b>in last <TMPL_VAR NAME=TIMESLICE>:</b><br> 
     
    8791</TMPL_LOOP> 
    8892 
    89  
    90  
    91  
    92  
    93 --- 
    94  
    95 <tr><td align=left valign=top nowrap> 
    96 <h2>Unique Users</h2> 
    97 <b>Number of unique systems seen:</b> <font color=lightgreen><i>(green)</i></font><br> 
    98 <TMPL_LOOP NAME=USERS> 
    99   <li>in last <TMPL_VAR NAME=TIMESLICE>:<b><TMPL_VAR NAME=SEEN></b> (previous <TMPL_VAR NAME=PREVIOUS>)</li> 
    100 </TMPL_LOOP> 
    101 </ul> 
    102 <b>TOTAL SEEN: <u><TMPL_VAR NAME=USERS_TOTAL></u></b> 
    103 </td><td nowrap><br> 
    104 <TMPL_LOOP NAME=GRAPHS_USERS> 
    105  <TMPL_VAR NAME=GRAPH> 
    106 </TMPL_LOOP> 
    107 </td></tr> 
    108  
    109 <tr><td align=left valign=top nowrap> 
    110 <h2>Start Time</h2> 
    111 <b>When shepherd checked in:</b> <font color=lightgreen><i>(green)</i></font><br> 
    112 (when shepherd is being run)</i><p> 
    113 (in 15 minute groups, time in GMT+10) 
    114 </td><td nowrap><br> 
    115 <TMPL_LOOP NAME=GRAPHS_RUNTIME> 
    116  <TMPL_VAR NAME=GRAPH> 
    117 </TMPL_LOOP> 
    118 </td></tr> 
    119  
    120 <tr><td align=left valign=top nowrap> 
    121 <h2>Duration</h2> 
    122 <b>How long shepherd took to run:</b><br> 
    123 <TMPL_LOOP NAME=DURATION> 
    124  <li><b>in last <TMPL_VAR NAME=TIMESLICE>:</b><br> 
    125  &nbsp;&nbsp;&nbsp;Avg: <TMPL_VAR NAME=AVG> <i><font color=lightgreen>(green)</font></i><br> 
    126  &nbsp;&nbsp;&nbsp;Min: <TMPL_VAR NAME=MIN> <i><font color=lightblue>(blue)</font></i><br> 
    127  &nbsp;&nbsp;&nbsp;Max: <TMPL_VAR NAME=MAX> <i><font color=pink>(red)</font></i><br> 
    128  </li> 
    129 </TMPL_LOOP> 
    130 </td><td nowrap align=left> 
    131 <TMPL_LOOP NAME=GRAPHS_DURATION> 
    132  <TMPL_VAR NAME=GRAPH> 
    133 </TMPL_LOOP> 
    134 </td></tr> 
    135  
    136 <tr><td align=left valign=top nowrap> 
    137 <h2>Timezones</h2> 
    138 <b>Where shepherd is being run:</b> <font color=lightgreen><i>(green)</i></font><br> 
    139 <i>(timezone setting of hosts)</i><p> 
    140 </td><td nowrap><br> 
    141 <TMPL_LOOP NAME=GRAPHS_TIMEZONE> 
    142  <TMPL_VAR NAME=GRAPH> 
    143 </TMPL_LOOP> 
    144 </td></tr> 
    145  
    146 <tr><td align=left valign=top nowrap colspan=2> 
    147 <h2>Components Used</h2> 
    148 <TMPL_LOOP NAME=COMPONENTS_USED> 
    149  <li><b>in last <TMPL_VAR NAME=TIMESLICE>:</b><br> 
    150  <TMPL_LOOP NAME=COMPONENTS_USED_TIMESLICES> 
    151   &nbsp;&nbsp;&nbsp;<b><TMPL_VAR NAME=TIMES></b>: <TMPL_VAR NAME=DETAIL><br> 
    152  </TMPL_LOOP> 
    153  </li> 
    154 </TMPL_LOOP> 
    155  
    156 <tr><td align=left valign=top nowrap colspan=2> 
    157 <h2>Detailed Component Statistics</h2> 
    158 <p><table align=center> 
    159 <TMPL_LOOP NAME=COMPONENTS> 
    160  <TMPL_IF NAME=FOURTH></tr><tr></TMPL_IF> 
    161  <td> 
    162  <b><a href="<TMPL_VAR NAME=NAME>.html"><TMPL_VAR NAME=NAME></a></b><br> 
    163  <b>Successful runs:</b><br> 
    164  <TMPL_LOOP NAME=COMPONENT_SUCCESS_RUNS> 
    165   <li>in last <TMPL_VAR NAME=TIMESLICE>: <b><TMPL_VAR NAME=SEEN></b> (previous <TMPL_VAR NAME=PREVIOUS>)</li> 
    166  </TMPL_LOOP> 
    167  <li><b>TOTAL SEEN: <u><TMPL_VAR NAME=COMPONENT_SUCCESS_RUNS_TOTAL></u></b></li> 
    168  <b>Failed runs:</b><br> 
    169  <TMPL_LOOP NAME=COMPONENT_FAIL_RUNS> 
    170   <li>in last <TMPL_VAR NAME=TIMESLICE>: <b><TMPL_VAR NAME=SEEN></b> (previous <TMPL_VAR NAME=PREVIOUS>)</li> 
    171  </TMPL_LOOP> 
    172  <li><b>TOTAL SEEN: <u><TMPL_VAR NAME=COMPONENT_FAIL_RUNS_TOTAL></u></b></li></td> 
    173 </TMPL_LOOP> 
    174  
    175 </tr></table> 
    176  
    17793</td></tr></table> 
    17894<br clear=all> 
  • util/server_daily_maint_main.tmpl

    r341 r350  
    11<html> 
    22<head> 
    3 <title>Shepherd</title> 
     3<title>Shepherd Statistics: Overall</title> 
    44<style> 
    55a { color: #F6B620; text-decoration: none; border-bottom: 1px dotted #F6B620; }