[rrd-developers] Re: PATCH: rrd_diff() and negative COUNTER/DERIVE datasource values

Tobias Oetiker oetiker at ee.ethz.ch
Mon Mar 10 01:26:37 MET 2003


Mar 4 Sasha Mikheev wrote:

> Hi,
>
> rrd_diff() does not produce correct result when 2 values are negative or
> have different
> signs. Some of the vendors (N*****k A*******e) have mibs where counter
> values can be negative.
> Also DERIVE datasource must work correctly even when both measurements are
> negative.
>
> Attached small patch against latest stable rrdtool to rrd_diff.c fixes the
> case when 2 values are negative. Fixing the last case does not
> have much practical value.

thanks will fix
>
> As a side question i wonder why not to convert function parameters to double
> using strtod() and
> then return the difference ?
>

if counters are high and difference is small this will not work ...

cheers
tobi

>  Sasha Mikheev
>
>  Avalon Net Ltd, CTO
>  +972-50-481787, +972-4-8210307
>  http://www.avalon-net.co.il
>
>
>
> -- Attached file removed by Ecartis and put at URL below --
> -- Type: application/octet-stream
> -- Size: 1k (1456 bytes)
> -- URL : http://www.ee.ethz.ch/~slist/pantomime/rrd_diff.c.diff
>
>
> --
> 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
>

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker, ETZ J97, ETH, CH-8092 Zurich, Switzerland
 / // _ \/ _ \/ /  System Manager Coach Time Lord Developer Designer
/_/ \.__/_.__/_/   http://people.ee.ethz.ch/~oetiker +41(0)1-632-5286

--
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