[rrd-developers] Discuss regarding Ticket 263
Tobias Oetiker
tobi at oetiker.ch
Wed May 19 00:38:03 CEST 2010
Hi Jean-Edouard,
the when part of the system simply does not make sense all the time
... eg for AVERAGE ...
how about having boolean flag in the structure called 'never' when
this is true your fct1 function would be called ...
cheers
tobi
Today Jean-Edouard Babin wrote:
> Hello,
>
> Yesterday I opened a new ticked
> http://oss.oetiker.ch/rrdtool-trac/ticket/263 because I got a wrong
> output when printing time of an empty VDEF. (time is 1st Jan 1970)
> I just find out why, in function vdef_calc of rrd_graph.c, cases
> (VDEF_MAXIMUM, VDEF_AVERAGE, VDEF_FIRST, ...) set dst->vf.when to 0 if
> value is unknow (which is my case).
>
> I would be happy to try to do a patch, but I would like to discuss how
> to do it before doing something. (I don't want to do something that
> will not be commited because it's not a proper solution)
>
> vdef struct is currently as follow:
>
> typedef struct vdef_t {
> enum vdef_op_en op;
> double param; /* parameter for function, if applicable */
> double val; /* resulting value */
> time_t when; /* timestamp, if applicable */
> } vdef_t;
>
> My idea would be to add a new 'isnull' boolean variable to the struct,
> so that in print_calc I could add some test on isnull be able to run
> something else that strftime (let's say fct1()) when isnull is true.
> fct1() would replace each %X values by '-'.
> So "GPRINT:maxabc2: Reach 100% @ %c :strftime" would print "Reach
> 100% @ -", "GPRINT:maxabc2: Reach 100% @ %Y/%m/%d :strftime" would
> print "Reach 100% @ -/-/-"
>
> Do you have any comments about this idea ?
>
> _______________________________________________
> rrd-developers mailing list
> rrd-developers at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
>
>
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900
More information about the rrd-developers
mailing list