[Nagiosplug-devel] Suggested alterations to the Performance Protocol

Yves Mettier ymettier at libertysurf.fr
Thu Sep 9 02:21:03 CEST 2004


> The only comment I have, apart from my desire to still use NULL, is that
> if we include time as UNIX time, we can't use float as the underlying
> data storage mechanism:
>
> Time:           1094718313
> Time -> Float:  1094718336.000000
> Float -> Time:  1094718336
> Time -> Double: 1094718313.000000
> Double -> Time: 1094718313
>
> Both PP and RRD will have to use double.  (I don't know what RRD
> currently uses.)

[...]

> Or is this is just too nasty, we will have to use double and double the
> size of our storage :)

Too nasty :)

The problem is not how we will code that. Perfparse will use double. RRD will use what
they like (they can also use strings, or better: struct timeval).

The problem is, for the parser, to identify what kind of data it reads. And we have the
unit for that.

For that reason, I'm noticing that a parser should not return some double or any other
type for the value, but a string. The program that uses the parser can then convert the
string to whatever :

if(perf_value_next(data,&result)) {
  if(strcmp(result.unit,"s")) {
    /* result.value is time and should be converted to struct timeval */
  } else {
    /* result.value is anything and we can try to convert it to double */
  }
}

perf_value_next() is the new parser for data perf for Perfparse. I have in mind to make
it extractable, in order to make an external library one day. A generic library to parse
perf data strings :)
For now, just wait, this is far from being finished, and it will first be part of
perfparse for debugging purpose and user-friendlyness for our users.

Yves
-- 
- Homepage    - http://ymettier.free.fr - http://www.logicacmg.com -
- GPG key     - http://ymettier.free.fr/gpg.txt                    -
- Maitretarot - http://www.nongnu.org/maitretarot/                 -
- GTKtalog    - http://www.nongnu.org/gtktalog/                    -







More information about the Devel mailing list