Mercurial > ~darius > hgwebdir.cgi > adslstats
comparison adslstats.py @ 5:072489c80c51
Change from PNG to SVG
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Fri, 07 Feb 2014 20:36:13 +1030 |
parents | f50214bca1ae |
children | 671e66da2cb9 |
comparison
equal
deleted
inserted
replaced
4:f50214bca1ae | 5:072489c80c51 |
---|---|
167 | 167 |
168 # Generate a graph | 168 # Generate a graph |
169 def gengraph(): | 169 def gengraph(): |
170 | 170 |
171 linkargs = ( | 171 linkargs = ( |
172 '-a', 'PNG', | 172 '-a', 'SVG', |
173 '-X', '0', | 173 '-X', '0', |
174 '--vertical-label', 'kbit/sec', | 174 '--vertical-label', 'kbit/sec', |
175 '--slope-mode', | 175 '--slope-mode', |
176 | 176 |
177 'DEF:upstream=%s:upstream:AVERAGE' % rrdname, | 177 'DEF:upstream=%s:upstream:AVERAGE' % rrdname, |
192 'LINE0:downstreammin#000000:', | 192 'LINE0:downstreammin#000000:', |
193 'AREA:downstreamdif#ff8686::STACK', | 193 'AREA:downstreamdif#ff8686::STACK', |
194 'LINE1:downstream#ff0000:Downstream') | 194 'LINE1:downstream#ff0000:Downstream') |
195 | 195 |
196 signalargs = ( | 196 signalargs = ( |
197 '-a', 'PNG', | 197 '-a', 'SVG', |
198 '--vertical-label', 'dB', | 198 '--vertical-label', 'dB', |
199 '--slope-mode', | 199 '--slope-mode', |
200 | 200 |
201 'DEF:upstream=%s:upstream:AVERAGE' % rrdname, | 201 'DEF:upstream=%s:upstream:AVERAGE' % rrdname, |
202 'DEF:downstream=%s:downstream:AVERAGE' % rrdname, | 202 'DEF:downstream=%s:downstream:AVERAGE' % rrdname, |
245 | 245 |
246 'LINE0:attendownmin#000000:', | 246 'LINE0:attendownmin#000000:', |
247 'AREA:attendowndif#aaaaaa::STACK', | 247 'AREA:attendowndif#aaaaaa::STACK', |
248 'LINE1:attendown#000000:Attenuation - Down') | 248 'LINE1:attendown#000000:Attenuation - Down') |
249 | 249 |
250 rrdtool.graph("%s-hour-link.png" % (graphbasename), | 250 rrdtool.graph("%s-hour-link.svg" % (graphbasename), |
251 '--width', '1024', | 251 '--width', '768', |
252 '--height', '256', | 252 '--height', '256', |
253 '--start', 'end - 7d', | 253 '--start', 'end - 7d', |
254 '--end', 'now', | 254 '--end', 'now', |
255 *linkargs) | 255 *linkargs) |
256 | 256 |
257 rrdtool.graph("%s-daily-link.png" % (graphbasename), | 257 rrdtool.graph("%s-daily-link.svg" % (graphbasename), |
258 '--width', '1024', | 258 '--width', '768', |
259 '--height', '256', | 259 '--height', '256', |
260 '--start', 'end - 365d', | 260 '--start', 'end - 365d', |
261 '--end', 'now', | 261 '--end', 'now', |
262 *linkargs) | 262 *linkargs) |
263 | 263 |
264 | 264 |
265 rrdtool.graph("%s-hour-signal.png" % (graphbasename), | 265 rrdtool.graph("%s-hour-signal.svg" % (graphbasename), |
266 '--width', '1024', | 266 '--width', '768', |
267 '--height', '256', | 267 '--height', '256', |
268 '--start', 'end - 7d', | 268 '--start', 'end - 7d', |
269 '--end', 'now', | 269 '--end', 'now', |
270 *signalargs) | 270 *signalargs) |
271 | 271 |
272 rrdtool.graph("%s-daily-signal.png" % (graphbasename), | 272 rrdtool.graph("%s-daily-signal.svg" % (graphbasename), |
273 '--width', '1024', | 273 '--width', '768', |
274 '--height', '256', | 274 '--height', '256', |
275 '--start', 'end - 365d', | 275 '--start', 'end - 365d', |
276 '--end', 'now', | 276 '--end', 'now', |
277 *signalargs) | 277 *signalargs) |
278 | 278 |