1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
|
#!/usr/bin/perl
use strict;
use warnings;
my $data = './taskd.rrd';
$data = shift if @ARGV;
die "Could not find data file: $data\n"
unless -f $data;
my $docs = '.';
$docs = shift if @ARGV;
die "Could not find output directory: $docs\n"
unless -d $docs;
# Show one month of data.
my $start = time () - 30*86_400;
my @graphs;
push @graphs, "rrdtool "
. "graph $docs/bytes.png "
. "--start $start "
. "--end now "
. "--title \"Taskserver :: Request/Response Bytes\" "
. "--watermark=\"`date`\" "
. "--vertical=\"Bytes\" "
. "--lower-limit=0 "
. "--width=600 "
. "--height=300 "
. "--slope-mode "
. "DEF:avgreq=$data:avgreq:AVERAGE "
. "DEF:avgres=$data:avgres:AVERAGE "
. "LINE2:avgreq#8dbecb:\"Avg Request Bytes\\l\" "
. "LINE2:avgres#43617f:\"Avg Response Bytes\"";
push @graphs, "rrdtool "
. "graph $docs/service.png "
. "--start $start "
. "--end now "
. "--title \"Taskserver :: Service Time\" "
. "--watermark=\"`date`\" "
. "--vertical=\"Time (s)\" "
. "--lower-limit=0 "
. "--width=600 "
. "--height=300 "
. "--slope-mode "
. "DEF:avgtime=$data:avgtime:AVERAGE "
. "DEF:maxres=$data:maxres:AVERAGE "
. "LINE2:avgtime#43617f:\"Avg Response Time\\l\" "
. "LINE2:maxres#8dbecb:\"Max Response Time\"";
push @graphs, "rrdtool "
. "graph $docs/txns.png "
. "--start $start "
. "--end now "
. "--title \"Taskserver :: Transactions\" "
. "--watermark=\"`date`\" "
. "--vertical=\"Transactions\" "
. "--lower-limit=0 "
. "--width=600 "
. "--height=300 "
. "--slope-mode "
. "DEF:tx=$data:tx:AVERAGE "
. "DEF:errors=$data:errors:AVERAGE "
. "LINE2:tx#43617f:\"Transactions\\l\" "
. "LINE2:errors#8dbecb:\"Errors\"";
push @graphs, "rrdtool "
. "graph $docs/idle.png "
. "--start $start "
. "--end now "
. "--title \"Taskserver :: Idle\" "
. "--watermark=\"`date`\" "
. "--vertical=\"%\" "
. "--lower-limit=0 "
. "--width=600 "
. "--height=300 "
. "--slope-mode "
. "DEF:idle=$data:idle:AVERAGE "
. "LINE2:idle#8dbecb:\"Idle %\"";
push @graphs, "rrdtool "
. "graph $docs/tps.png "
. "--start $start "
. "--end now "
. "--title \"Taskserver :: TPS\" "
. "--watermark=\"`date`\" "
. "--vertical=\"Transactions\" "
. "--lower-limit=0 "
. "--width=600 "
. "--height=300 "
. "--slope-mode "
. "DEF:tps=$data:tps:AVERAGE "
. "LINE2:tps#8dbecb:\"Transactions Per Second\"";
push @graphs, "rrdtool "
. "graph $docs/orgs.png "
. "--start $start "
. "--end now "
. "--title \"Taskserver :: Organizations\" "
. "--watermark=\"`date`\" "
. "--vertical=\"Organizations\" "
. "--lower-limit=0 "
. "--width=600 "
. "--height=300 "
. "--slope-mode "
. "DEF:orgs=$data:orgs:AVERAGE "
. "LINE2:orgs#8dbecb:\"Organizations\"";
push @graphs, "rrdtool "
. "graph $docs/users.png "
. "--start $start "
. "--end now "
. "--title \"Taskserver :: Users\" "
. "--watermark=\"`date`\" "
. "--vertical=\"Users\" "
. "--lower-limit=0 "
. "--width=600 "
. "--height=300 "
. "--slope-mode "
. "DEF:users=$data:users:AVERAGE "
. "LINE2:users#8dbecb:\"Users\"";
push @graphs, "rrdtool "
. "graph $docs/data.png "
. "--start $start "
. "--end now "
. "--title \"Taskserver :: User Data\" "
. "--watermark=\"`date`\" "
. "--vertical=\"User Data\" "
. "--lower-limit=0 "
. "--width=600 "
. "--height=300 "
. "--slope-mode "
. "DEF:data=$data:data:AVERAGE "
. "LINE2:data#8dbecb:\"User Data\"";
push @graphs, "rrdtool "
. "graph $docs/total_bytes.png "
. "--start $start "
. "--end now "
. "--title \"Taskserver :: Bytes In/Out\" "
. "--watermark=\"`date`\" "
. "--vertical=\"Bytes\" "
. "--lower-limit=0 "
. "--width=600 "
. "--height=300 "
. "--slope-mode "
. "DEF:in=$data:in:AVERAGE "
. "DEF:out=$data:out:AVERAGE "
. "LINE2:in#8dbecb:\"Total Bytes In\\l\" "
. "LINE2:out#43617f:\"Total Bytes Out\"";
push @graphs, "rrdtool "
. "graph $docs/uptime.png "
. "--start $start "
. "--end now "
. "--title \"Taskserver :: Uptime\" "
. "--watermark=\"`date`\" "
. "--vertical=\"Time\" "
. "--lower-limit=0 "
. "--width=600 "
. "--height=300 "
. "--slope-mode "
. "DEF:uptime=$data:uptime:AVERAGE "
. "LINE2:uptime#8dbecb:\"Uptime\"";
print qx{$_ >/dev/null}for @graphs;
exit 0;
|