Unify the timestamp of samples generated by polling agents¶
Many of the pollsters define the timestamp individually for each generated sample, which should really be timestamping based on when the data was polled and not when each sample is generated. We need to set the timestamp of the polled data to the timestamp when the polling starts for unity.
This should save overhead of calculating timestamp each sample and also allow for easier grouping of polled data.
Modify ceilometer.agent.manager.PollingTask.poll_and_notify method to set the timestamp of samples to the time when the data was polled:
# Get the timestamp when pollster starts to work polling_timestamp = self._get_current_timestamp() samples = pollster.obj.get_samples( manager=self.manager, cache=cache, resources=polling_resources ) for sample in samples: # Unify the timestamp of polled samples sample.set_timestamp(polling_timestamp)
Drop all the timestamp generations when we build samples via pollsters, like: https://github.com/openstack/ceilometer/blob/184.108.40.206b2/ceilometer/image/glance.py#L113
Data model impact¶
REST API impact¶
Other end user impact¶
Save overhead of calculating timestamp each sample.
Other deployer impact¶
- Primary assignee:
Update ceilometer.agent.manager.PollingTask.poll_and_notify method.
Drop all the timestamp generations when we build samples via pollsters.
Add unit test to test: The timestamp of samples generated during a polling cycle is unified.
Originally reported as a bug: https://bugs.launchpad.net/ceilometer/+bug/1491509 Blueprint: https://blueprints.launchpad.net/ceilometer/+spec/unify-timestamp-of-polled-data