[rrd-developers] Printing of time component

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Thu Aug 9 20:42:33 MEST 2001


Hi,

Can you please tell me if I'm on the right track here:

The VDEF variables have both a value (rate) component and a
time component.  Printing the rate is no problem, this is
already implemented and seems to work.  Now for printing the
time component:

1) Which set of formatters can be used.  Doing a man strftime on
   a linux system shows that there may be some formatters that
   are not available on each system.  Is there a place where I can
   find a "safe set" of them, is it better to program everything
   myself (not a problem but seems to be re-inventing the wheel) or
   should I just use strftime and let each user find out which one
   can or cannot be used?  I'm particullarry worried about the
   availability of '%s' which I assume not to be so wide-spread as
   other strings.

2) There is a little problem with %S (seconds) and %s (time since
   the epoch) as they are also used by value printing.  It seems to
   me that it is easy to define some parsing rules.  If the parser
   fails to do it right, the PRINT can be separated into two different
   ones and everything will be all right.

   a) If a value is printed and the next formatter string is %s or %S,
      a SI unit is substituted
   b) If no value is printed, it must mean time
   c) If a value is printed but between this value and the %s there is
      some other formatter, it means time.

   This means "%6.2lf %sbps" or "%6.2lf %Sbps will print 123.45 kbps,
   and "%6.2lf %H:%S" will print 123.45 23:15
   If you really want "%6.2lf %s" to print 123.45 997382402, then
   it should be programmed as two different (G)PRINTS.

Thanks in advance for any help you can give me,
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
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://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list