Changeset 458
- Timestamp:
- 01/11/07 19:15:55 (6 years ago)
- Location:
- util
- Files:
-
- 2 modified
-
server_daily_maint (modified) (4 diffs)
-
server_daily_maint_component.tmpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
util/server_daily_maint
r457 r458 383 383 $store->{total}->{'c_'.$c.'_runs'}++; 384 384 $store->{per_hour}->[$hr_num]->{$g."_sysid_list"}->{$sid}++ if ($sid); 385 if ($retcode =~ /(.*):(.*)/) 386 { 387 my ($code, $msg) = ($1, $2); 388 my $shortsid = $1 if ($sid =~ /\d+\.(\d+)/); 389 unshift @{$store->{failcodes}->{$c}}, { timestamp => $starttime, sysid => $shortsid, file => $file, code => $code, msg => $msg }; 390 } 385 391 386 392 # duration (total count, min, max, average from duration/counter) … … 535 541 my $color = ($n < 75 ? "red" : $n < 90 ? "orange" : "lightgreen"); 536 542 return "<font color=\"$color\">$n%</font>"; 543 } 544 545 sub report_failure_msgs 546 { 547 my ($template, $c) = @_; 548 549 return unless $store->{failcodes}->{$c}; 550 551 my @msgs; 552 for (my $i = 0; $i < @{$store->{failcodes}->{$c}}; $i++) 553 { 554 my %h = %{$store->{failcodes}->{$c}[$i]}; 555 556 # Remove any entries older than 1 week 557 if ($h{timestamp} + 604800 < $starttime) 558 { 559 splice(@{$store->{failcodes}->{$c}}, $i); 560 last; 561 } 562 $h{timestamp} = strftime("%a %d %b %H:%M", localtime($h{timestamp})); 563 $h{msg} = '(no msg)' unless $h{msg}; 564 push @msgs, { %h }; 565 } 566 567 $template->param(FAILURE_MSGS => \@msgs); 537 568 } 538 569 … … 1016 1047 my @ret = report_count_data(0, 0, "c_".$c."_success_sysid_list", "all"); 1017 1048 $h->{'COMPONENT_SUCCESS_RUNS'} = $ret[0]; 1018 # $h->{'COMPONENT_SUCCESS_RUNS_TOTAL'} = $ret[1];1019 1049 @ret = report_count_data(0, 0, "c_".$c."_fail_sysid_list", "all", "ignore-zero"); 1020 1050 $h->{'COMPONENT_FAIL_RUNS'} = $ret[0]; 1021 # $h->{'COMPONENT_FAIL_RUNS_TOTAL'} = $ret[1];1022 1051 1023 1052 $h->{'SUCCESS_RATE_WEEK'} = calc_success_rate($c, "week"); … … 1051 1080 $template->param('NAME', $c); 1052 1081 1053 &report_count_data($template, 'SUCCESS', 'c_'.$c.'_success_sysid_list', 'all');1054 &report_count_data($template, 'MISSING', 'c_'.$c.'_missing_sysid_list', 'all');1055 &report_count_data($template, 'FAILURE', 'c_'.$c.'_fail_sysid_list', 'all');1056 &graph_count_data($template, 'GRAPHS_USAGE', 'day week 12week year', 0, 'c_'.$c.'_success_sysid_list', 'c_'.$c.'_missing_sysid_list', 'c_'.$c.'_fail_sysid_list');1082 &report_count_data($template, 'SUCCESS', 'c_'.$c.'_success_sysid_list', 'all'); 1083 &report_count_data($template, 'MISSING', 'c_'.$c.'_missing_sysid_list', 'all'); 1084 &report_count_data($template, 'FAILURE', 'c_'.$c.'_fail_sysid_list', 'all'); 1085 &graph_count_data($template, 'GRAPHS_USAGE', 'day week 12week year', 0, 'c_'.$c.'_success_sysid_list', 'c_'.$c.'_missing_sysid_list', 'c_'.$c.'_fail_sysid_list'); 1057 1086 1058 1087 &report_count_data($template, 'RUNS_SEEN', 'c_'.$c.'_runs', "all"); 1059 1088 &graph_count_data($template, 'GRAPHS_RUNS', "day week 12week year", 0, 'c_'.$c.'_runs'); 1089 1090 &report_failure_msgs($template, $c); 1060 1091 1061 1092 my @sf; -
util/server_daily_maint_component.tmpl
r457 r458 32 32 <TMPL_LOOP NAME=GRAPHS_MISSING> 33 33 <br><TMPL_VAR NAME=GRAPH> 34 </TMPL_LOOP> 35 </td></tr> 36 37 <tr><td align=left valign=top nowrap colspan=2> 38 <h2>Failures</h2> 39 <p>Output from recent failures</p> 40 <TMPL_LOOP NAME=FAILURE_MSGS> 41 <li><a href="/dev/stats/<TMPL_VAR NAME=FILE>.done"><TMPL_VAR NAME=TIMESTAMP></a> [<TMPL_VAR NAME=SYSID>]: <b><TMPL_VAR NAME=CODE></b>: <TMPL_VAR NAME=MSG></li> 34 42 </TMPL_LOOP> 35 43 </td></tr>
