def setup(self): self.host_os = Mock() self.host_os.cpu_count.return_value = 2 self.host_os.cpu_times.return_value = CpuTimes(*[0 for _ in CPU_TIMES]) self.shift = 5 self.collector = CpuTimesCollector(self.shift, self.host_os)
def __init__(self): super(Linux, self).__init__() self._disk_device_stats_collector = DiskDeviceStatsCollector(900, self) self._collectors.append(self._disk_device_stats_collector) self._cpu_times_collector = CpuTimesCollector(900, self) self._collectors.append(self._cpu_times_collector)