[kea-dev] Fwd: Fwd: Re: Statistics design proposal for 0.9.2

Thomas Markwalder tmark at isc.org
Thu Apr 16 16:57:05 UTC 2015


On 4/16/15 12:50 PM, Thomas Markwalder wrote:

>
> ----------------------------------------------------------------------
> Regarding the Observation class:
>
> It occurs to me that this class is very similar to ValueStorage template
> class in libdhcprsv.  The primary difference is that rather than storing
> name-value pairs as ValueStorage does, these would store timestamp-value
> pairs.  
>
> With the current design it would be possible for a developer to mistakenly
> add a duration or a double to a statistic intended to be an integer counter.
> There's no explicit way to say this statistic is of a one data type or
> another.
>
> The class also seems to be missing attributes for retaining maximum samples
> or sample age, values set by setStorage() methods. 
>
> The name setStorage() is something of a misnomer. The name sounds like
> it would
> set everything to zero or something.  In fact, rather than overload it,
> I think it would
> be clearer to have two distinct methods: setMaxSampleCount() and
> setMaxSampleAge().
> These two limits do not have to be mutually exclusive and using the same
> method
> name for both implies that the class enforces one limit or the other.
>
I forgot to include that the parallel here does not stop with
ValueStorage<> but extends
to the dhcpsrv ParserContext class and how it utilizes the
ValueStorage<> class.

Thomas




More information about the kea-dev mailing list