Comment 2 for bug 1417949

Revision history for this message
Antonio Messina (arcimboldo) wrote :

I think you will always loose data if you use polling. The more often you poll, the less data you lose, but you will lose some.

However, having "cpu" as a cumulative value is, IMHO, wrong, because as it is it's basically useless. There are two problems:

1) you cannot get a reliable value, because you cannot know if the server was rebooted or not, so you cannot just get "max"
2) you cannot easily get the cpu time used *in a specified period of time* (you should subtract the last and the first sample in the time window, but again, if the server was rebooted you could get a negative/meaningless value)

What you need instead of a cumulative metric is a "kind" of delta, and store how much cpu-time was used since last time you polled the value. AND, you have to correct this value in case the last value is greater than the current one (e.g. in case of a reboot).

If you use a delta instead of a cumulative metric you can still lose some data, but at least sum() will return a *reasonable* value (+ or - your polling interval).