From 6384c2924b30509f5412241ee92e1271f36d3501 Mon Sep 17 00:00:00 2001 From: Kaiyan Sheng Date: Mon, 15 Aug 2016 16:10:44 -0600 Subject: [PATCH] Disk collection period has inconsistent collection timestamps _last_disk_collect_time should be measured in prepare_run which is before the actual check runs. This will make sure the disk collect time is consistent with disk_collection_period. Change-Id: I75ef4ca75aa22172ab6203dd8fe21d2e0b7c91f9 Closes-Bug: #1613463 --- monasca_agent/collector/checks_d/libvirt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monasca_agent/collector/checks_d/libvirt.py b/monasca_agent/collector/checks_d/libvirt.py index 0f6a66f2..40b4c4d1 100644 --- a/monasca_agent/collector/checks_d/libvirt.py +++ b/monasca_agent/collector/checks_d/libvirt.py @@ -577,6 +577,7 @@ class LibvirtCheck(AgentCheck): self._skip_disk_collection = True else: self._skip_disk_collection = False + self._last_disk_collect_time = datetime.now() def _run_ping(self, dims_customer, dims_operations, inst_name, instance_cache, net): """Create a ping command and hand it off to the Thread Pool""" @@ -708,7 +709,6 @@ class LibvirtCheck(AgentCheck): if self.init_config.get('vm_cpu_check_enable'): self._inspect_cpu(insp, inst, inst_name, instance_cache, metric_cache, dims_customer, dims_operations) if not self._skip_disk_collection: - self._last_disk_collect_time = datetime.now() if self.init_config.get('vm_disks_check_enable'): self._inspect_disks(insp, inst, inst_name, instance_cache, metric_cache, dims_customer, dims_operations)