Changeset 417

Show
Ignore:
Timestamp:
01/03/07 16:17:00 (6 years ago)
Author:
max
Message:

Add key to component failure graphs, remove long-term ones

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • util/server_daily_maint

    r412 r417  
    854854sub graph_count_data 
    855855{ 
    856         my ($template, $varname, $request, @fields) = @_; 
     856        my ($template, $varname, $request, $show_key, @fields) = @_; 
    857857 
    858858        my @requests = split(/ /, $request); 
     
    880880                $title = "Last $max $timeslice" . 's' unless ($title); 
    881881 
    882                 my $fieldnum = 0, my $d, my $fielddesc = ""; 
     882                my $fieldnum = 0, my $d, my $fielddesc = "", my @keys; 
    883883                foreach my $field (@fields)  
    884884                { 
     885                        my $anydata = 0; 
     886                        my @data; 
    885887                        for (my $i = ($max-1); $i >= 0; $i--)  
    886888                        { 
     
    896898                                } 
    897899                                my $time_offset = $starttime - ($i * $tdata->{$timeslice}->{n}); 
    898                                 push(@{$d->[$fieldnum]}, strftime("%Y-%m-%d %H:%M:%S", localtime($time_offset)), $val); 
     900                                push(@data, strftime("%Y-%m-%d %H:%M:%S", localtime($time_offset)), $val); 
     901                                $anydata = 1 if ($val); 
    899902                        } 
    900                         $fieldnum++; 
    901                         $fielddesc .= $field."_";                  
     903                        $fielddesc .= $field."_"; 
     904                        if ($anydata) 
     905                        { 
     906                            push (@{$d->[$fieldnum]}, @data); 
     907                            $fieldnum++; 
     908                            if ($show_key) 
     909                            { 
     910                                my $k = $field; 
     911                                $k = $1 if ($k =~ /^c_(.+)_fail/); 
     912                                push (@keys, $k); 
     913                            } 
     914                        } 
    902915                } 
    903916                $fielddesc = substr($fielddesc, 0, 150) . "-more-" if (length($fielddesc) > 160); 
     
    908921                                                               "$ts $timeslice" . 's', 
    909922                                                               $d, 
    910                                                                0, 
    911                                                                $varname =~ /duration/i) };  
     923                                                               $show_key ? 505 : 0, 
     924                                                               ($varname =~ /duration/i ? 1 : 0), 
     925                                                               ($show_key ? \@keys : undef) ) };  
    912926        } 
    913927 
     
    932946        &report_count_data($template, 'MISSING', 'missing_sysid_list', 'all'); 
    933947        &report_count_data($template, 'FAILURE', 'fail_sysid_list', 'all'); 
    934         &graph_count_data($template, 'GRAPHS_USAGE', 'day week 12week year', 'success_sysid_list', 'missing_sysid_list', 'fail_sysid_list'); 
     948        &graph_count_data($template, 'GRAPHS_USAGE', 'day week 12week year', 0, 'success_sysid_list', 'missing_sysid_list', 'fail_sysid_list'); 
    935949 
    936950        &graph_missing_data($template, 'GRAPHS_MISSING'); 
    937951 
    938952        &report_count_data($template, 'RUNS_SEEN', "visits", "all"); 
    939         &graph_count_data($template, 'GRAPHS_RUNS', "day week 12week year", "visits"); 
     953        &graph_count_data($template, 'GRAPHS_RUNS', "day week 12week year", 0, "visits"); 
    940954 
    941955        my @graphs = (); 
     
    957971        $template->param('DURATION' => \@duration); 
    958972 
    959         &graph_count_data($template, 'GRAPHS_DURATION', "day week 12week year", "duration_min", "duration", "duration_max"); 
     973        &graph_count_data($template, 'GRAPHS_DURATION', "day week 12week year", 0, "duration_min", "duration", "duration_max"); 
    960974 
    961975        @graphs = ( ); 
     
    10361050        $template->param('COMPONENTS', \@components); 
    10371051        $template->param('CFAILURES', \@cfailures); 
    1038         &graph_count_data($template, 'CFAILURE_GRAPHS', 'day week 12week year', @counters); 
     1052        &graph_count_data($template, 'CFAILURE_GRAPHS', 'day week', 1, @counters); 
    10391053 
    10401054        print "Generating index.html...\n\n" if ($debug); 
     
    10561070                &report_count_data($template, 'COMPONENT_SUCCESS_RUNS', "c_".$c."_success_counter", "all"); 
    10571071                &report_count_data($template, 'COMPONENT_FAIL_RUNS', "c_".$c."_fail_counter", "brief"); 
    1058                 &graph_count_data($template, 'GRAPHS_OVERALL', "day week 12week year", "c_".$c."_success_counter", "c_".$c."_fail_counter"); 
     1072                &graph_count_data($template, 'GRAPHS_OVERALL', "day week 12week year", 0, "c_".$c."_success_counter", "c_".$c."_fail_counter"); 
    10591073 
    10601074                my @sf;  
     
    10961110                        $h->{'DURATIONS'} = \@durations; 
    10971111 
    1098                         $h->{'GRAPHS_DURATIONS'} = &graph_count_data(undef, undef, "day week 12week year",$g."_duration", $g."_duration_min", $g."_duration_max"); 
     1112                        $h->{'GRAPHS_DURATIONS'} = &graph_count_data(undef, undef, "day week 12week year", 0, $g."_duration", $g."_duration_min", $g."_duration_max"); 
    10991113                        push @sf, $h; 
    11001114                } 
     
    11221136                            } 
    11231137                        } 
    1124                         push @statistics, { STATNAME => $sname, TIMESLICES => [ @timeslices ], GRAPHS_STATISTICS => &graph_count_data(undef, undef, "72hour 12week",$svar."_duration", $svar."_duration_min", $svar."_duration_max")}; 
     1138                        push @statistics, { STATNAME => $sname, TIMESLICES => [ @timeslices ], GRAPHS_STATISTICS => &graph_count_data(undef, undef, "72hour 12week", 0, $svar."_duration", $svar."_duration_min", $svar."_duration_max")}; 
    11251139                } 
    11261140                $template->param(STATISTICS => \@statistics);