class BaseCpuNodePuller(MetricPuller): def __init__(self, title, probe_id, interval): super(BaseCpuNodePuller, self).__init__( title=title, probe_id=probe_id, interval=interval, ) self.wrapper = HostMonitoring() @property def metric(self): raise NotImplementedError # HostMetric attribute @property def unit(self): raise NotImplementedError # (unicode string) def do_pull(self): """Retrives the number of CPUs on the host""" LOG.info("[%s] Pulling measurements...", self.key) value = self.wrapper.cpu_usage(self.metric) resource_metadata = { "host": platform.node(), "title": self.title } measurement = Measurement( name=self.probe_id, unit=self.unit, type_="gauge", value=value, resource_id=platform.node(), resource_metadata=resource_metadata, ) LOG.info("[%s] Measurements collected.", self.key) return [measurement]