[users at i-scream] "converting" statistic counters to unsigned values

Jens Rehsack rehsack at googlemail.com
Thu Jan 13 20:41:13 GMT 2011


Hi there,

during our development using libstatgrab we detected, that it's
unfortunate that the counters
in libstatgrab's statistics are signed.

Would anyone care if I modify the structures that way, to get all
those counters which can't
become negative (which are at least all I remember) using an unsigned
representation?

When thinking about cpu cycles, network traffic, file system sizes
etc. - none of them
can ever become lower than 0. And even if a diff is requested (which
is usually between
earlier snapshot and now), it will not become negative (in most cases).

In the few cases where a snapshot from time t2 is compared to a
snapshot from time t1
(with t2 > t1) with val(t2) as "early" argument, diff can be modified
to return the absolute
difference.

Any objections against this change?

Best regards,
Jens




More information about the users mailing list