[rrd-developers] Patch to rrd_graph.c for printing only epoch time of a VDEF
Stefan Moser
sm at open.ch
Thu May 19 12:54:23 MEST 2005
[blimey. forgot to add the patch first time around]
Hi Tobi,
I've written a small patch for rrd_graph.c to be able to print the epoch time
value instead of the ctime(3) formatted date string as is the default. I've
chosen %t for the formatter string (strftime uses %s, but this might lead to
confusion with the %s used for magnitude).
Example:
# rrdtool graph foo.png DEF:foo=foo.rrd:outOctets:AVERAGE \
VDEF:vfoo=foo,MAXIMUM PRINT:vfoo:'%lf'
0x0
90941.089605
# rrdtool graph foo.png DEF:foo=foo.rrd:outOctets:AVERAGE \
VDEF:vfoo=foo,MAXIMUM PRINT:vfoo:'%c'
0x0
Thu May 19 08:20:00 2005 (1116483600)
# rrdtool graph foo.png DEF:foo=foo.rrd:outOctets:AVERAGE \
VDEF:vfoo=foo,MAXIMUM PRINT:vfoo:'%lf'
0x0
1116483600
BTW, does the documentation of the date/time formatters for the PRINT
instruction (rrdgraph_graph.en.html) document features not implemented yet?
It says there that all manner of time format strings are supported, but in
reality, only %c works (which the code seems to confirm). Or am I just not
getting it?
cheers
-stefan
-- Attached file removed by Ecartis and put at URL below --
-- Type: text/plain
-- Size: 889 bytes
-- URL : http://lists.ee.ethz.ch/p/rrd_graph.c.printtime.patch
--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-developers
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-developers
mailing list