def test_GzippedWhisperReader_get_intervals(self): self.create_whisper_hosts() self.addCleanup(self.wipe_whisper_hosts) reader = GzippedWhisperReader(self.worker4, 'hosts.worker4.cpu') ts = int(time.time()) intervals = reader.get_intervals() for interval in intervals: self.assertEqual(int(interval.start), ts - 60) self.assertEqual(int(interval.end), ts) # read it again to validate cache works intervals = reader.get_intervals() for interval in intervals: self.assertEqual(int(interval.start), ts - 60) self.assertEqual(int(interval.end), ts)
def test_GzippedWhisperReader_get_intervals(self): self.create_whisper_hosts() self.addCleanup(self.wipe_whisper_hosts) reader = GzippedWhisperReader(self.worker4, 'hosts.worker4.cpu') intervals = reader.get_intervals() for interval in intervals: self.assertEqual(int(interval.start), self.start_ts - 60) self.assertEqual(int(interval.end), self.start_ts)
def test_GzippedWhisperReader_get_intervals(self): self.create_whisper_hosts() self.addCleanup(self.wipe_whisper_hosts) reader = GzippedWhisperReader(self.worker4, 'hosts.worker4.cpu') intervals = reader.get_intervals() for interval in intervals: self.assertEqual(int(interval.start), self.start_ts-60) self.assertEqual(int(interval.end), self.start_ts)