deb-ceilometer/ceilometer/transformer
Mehdi Abaakouk 251a06d5c6 High precision rate of change timedelta
The current way to calculate rate of change is not precise at all and
depends on the local host clock. So, we have good chance that the host
clock derive a bit between each polling. Also the timestamp is polling
cycle run and not the exact polled sample.

This makes the rate of change transformer not accurate, and maybe wrong
if the local clock have jumped to much or if a pollster make to much
time to get the stats (libvirt reconnection, ...).

A sample gets a new attribute monotonic_time, where we can store an
accurate polling time using monotonic.monotonic().

In rate of change transformer, if the monotonic time is available we use
to calculate the time delta between samples.

For instance metrics, we set monotonic_time as soon as we poll it from
libvirt, avoiding almost all precision issue.

That makes the rate of change precise to the nanoseconds for polled
samples, while keeping the timestamp identical for all samples polled
during one cycle.

Related-bug: #1527620
Change-Id: I40e14fb6aa595a86df9767be5758f52b7ceafc8f
(cherry picked from commit fd6a76601a382cdf47527893f9255b48bc235d05)
2017-07-20 17:00:59 +02:00
..
__init__.py publisher: clean out context usage 2016-04-01 09:51:54 +02:00
accumulator.py publisher: clean out context usage 2016-04-01 09:51:54 +02:00
arithmetic.py publisher: clean out context usage 2016-04-01 09:51:54 +02:00
conversions.py High precision rate of change timedelta 2017-07-20 17:00:59 +02:00