Пример #1
0
 def single_iteration():
   try:
     system_metrics.get_cpu_info()
     system_metrics.get_disk_info()
     system_metrics.get_mem_info()
     system_metrics.get_net_info()
     system_metrics.get_proc_info()
     puppet_metrics.get_puppet_summary()
   finally:
     ts_mon.flush()
   return True
Пример #2
0
  def test_cpu_info(self):
    system_metrics.get_cpu_info()

    user = system_metrics.cpu_time.get({'mode': 'user'})
    system = system_metrics.cpu_time.get({'mode': 'system'})
    idle = system_metrics.cpu_time.get({'mode': 'idle'})

    self.assertIsNotNone(user)
    self.assertIsNotNone(system)
    self.assertIsNotNone(idle)
    self.assertBetween(0, 100, user)
    self.assertBetween(0, 100, system)
    self.assertBetween(0, 100, idle)