Changeset 417
- Timestamp:
- 01/03/07 16:17:00 (6 years ago)
- Files:
-
- 1 modified
-
util/server_daily_maint (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
util/server_daily_maint
r412 r417 854 854 sub graph_count_data 855 855 { 856 my ($template, $varname, $request, @fields) = @_;856 my ($template, $varname, $request, $show_key, @fields) = @_; 857 857 858 858 my @requests = split(/ /, $request); … … 880 880 $title = "Last $max $timeslice" . 's' unless ($title); 881 881 882 my $fieldnum = 0, my $d, my $fielddesc = "" ;882 my $fieldnum = 0, my $d, my $fielddesc = "", my @keys; 883 883 foreach my $field (@fields) 884 884 { 885 my $anydata = 0; 886 my @data; 885 887 for (my $i = ($max-1); $i >= 0; $i--) 886 888 { … … 896 898 } 897 899 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); 899 902 } 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 } 902 915 } 903 916 $fielddesc = substr($fielddesc, 0, 150) . "-more-" if (length($fielddesc) > 160); … … 908 921 "$ts $timeslice" . 's', 909 922 $d, 910 0, 911 $varname =~ /duration/i) }; 923 $show_key ? 505 : 0, 924 ($varname =~ /duration/i ? 1 : 0), 925 ($show_key ? \@keys : undef) ) }; 912 926 } 913 927 … … 932 946 &report_count_data($template, 'MISSING', 'missing_sysid_list', 'all'); 933 947 &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'); 935 949 936 950 &graph_missing_data($template, 'GRAPHS_MISSING'); 937 951 938 952 &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"); 940 954 941 955 my @graphs = (); … … 957 971 $template->param('DURATION' => \@duration); 958 972 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"); 960 974 961 975 @graphs = ( ); … … 1036 1050 $template->param('COMPONENTS', \@components); 1037 1051 $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); 1039 1053 1040 1054 print "Generating index.html...\n\n" if ($debug); … … 1056 1070 &report_count_data($template, 'COMPONENT_SUCCESS_RUNS', "c_".$c."_success_counter", "all"); 1057 1071 &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"); 1059 1073 1060 1074 my @sf; … … 1096 1110 $h->{'DURATIONS'} = \@durations; 1097 1111 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"); 1099 1113 push @sf, $h; 1100 1114 } … … 1122 1136 } 1123 1137 } 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")}; 1125 1139 } 1126 1140 $template->param(STATISTICS => \@statistics);
