OLD | NEW |
1 #! /bin/sh | 1 #! /bin/sh |
2 | 2 |
3 # This script parses /var/log/syslog for messages from programs that log | 3 # This script parses /var/log/syslog for messages from programs that log |
4 # uptime and disk stats (number of sectors read). It then outputs | 4 # uptime and disk stats (number of sectors read). It then outputs |
5 # these stats in a format usable by the metrics collector, which forwards | 5 # these stats in a format usable by the metrics collector, which forwards |
6 # them to autotest and UMA. | 6 # them to autotest and UMA. |
7 | 7 |
8 # To add a new metric add a line below, as PROGRAM_NAME METRIC_NAME. | 8 # To add a new metric add a line below, as PROGRAM_NAME METRIC_NAME. |
9 # PROGRAM_NAME is the name of the job whose start time we | 9 # PROGRAM_NAME is the name of the job whose start time we |
10 # are interested in. METRIC_NAME is the prefix we want to use for | 10 # are interested in. METRIC_NAME is the prefix we want to use for |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 # Do all the differencing here | 60 # Do all the differencing here |
61 program="${program}\ | 61 program="${program}\ |
62 END{ | 62 END{ |
63 for (i in metrics_stop) { | 63 for (i in metrics_stop) { |
64 value_time = metrics_stop[i] - metrics_start[i]; | 64 value_time = metrics_stop[i] - metrics_start[i]; |
65 print i \"=\" value_time; | 65 print i \"=\" value_time; |
66 } | 66 } |
67 }" | 67 }" |
68 | 68 |
69 exec awk "$program" /var/log/syslog | 69 exec awk "$program" /var/log/syslog |
OLD | NEW |