pcp
[Top] [All Lists]

Re: Floating point problem

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Subject: Re: Floating point problem
From: fche@xxxxxxxxxx (Frank Ch. Eigler)
Date: Mon, 28 Jul 2014 20:28:55 -0400
Cc: Martin Spier <mspier@xxxxxxxxxxx>, pcp@xxxxxxxxxxx, Amer Ather <aather@xxxxxxxxxxx>, Coburn Watson <cwatson@xxxxxxxxxxx>, Brendan Gregg <bgregg@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <53D6CE6A.8030309@xxxxxxxxxxxxxxxx> (Ken McDonell's message of "Tue, 29 Jul 2014 08:27:54 +1000")
References: <CAEp4+dU2kE9JJztBPc=N5oSyoEyBvN5Of19rohC3DxXGeomuRw@xxxxxxxxxxxxxx> <033501cfa8a4$fd091ed0$f71b5c70$@internode.on.net> <CAEp4+dUH6fEQ2E=o5O2q8LKfR2xUypM-AeOwQhWy9sEntvO-AQ@xxxxxxxxxxxxxx> <53D6CE6A.8030309@xxxxxxxxxxxxxxxx>
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)
Hi, Ken -


kenj wrote:

> [...]
> The expressions above will produce exactly the floating point
> precision problem Martin has observed.
>
> The options are ...
>
> 1. Revisit the design specs for pmwebd and see if it makes sense for
> this daemon to be performing per-client rate conversion (so taking on
> some of the role of a PMAPI client, like pmie, pmval, pmchart,
> pmdumptext, ... [...]

This is possible (and can be encoded in a backward-compatible way).
As pmwebd is a PMAPI bridge, it is both a client and a server.
Indeed, this calculation may not be too difficult to code up in this
code, benefitting as it does from C++ and readily available context
usage statistics.  (Just for completeness, I'd like to re-mention the
alternative of having libpcp do this, so this many individual PMAPI
clients don't have to.)


> 2. Push the rate conversion arithmetic out the the pmwebd clients
> [...]

This is possible too, but we may need to have the derived-metrics
machinery preserve numerical precision (and not devolve to floating
point numbers prematurely).


> 3. Extend the derived metrics support [with rate conversion intrinsics]

This is possible too.


- FChE

<Prev in Thread] Current Thread [Next in Thread>