예제 #1
0
    def testMsrRuns(self):
        platform_backend = win_platform_backend.WinPlatformBackend()
        power_monitor = msr_power_monitor.MsrPowerMonitorWin(platform_backend)
        if not power_monitor.CanMonitorPower():
            logging.warning('Test not supported on this platform.')
            return

        power_monitor.StartMonitoringPower(None)
        time.sleep(0.01)
        statistics = power_monitor.StopMonitoringPower()

        self.assertEqual(statistics['identifier'], 'msr')
        self.assertIn('energy_consumption_mwh', statistics)
        self.assertGreater(statistics['energy_consumption_mwh'], 0)
예제 #2
0
 def __init__(self):
   super(WinPlatformBackend, self).__init__()
   self._msr_server_handle = None
   self._msr_server_port = None
   self._power_monitor = msr_power_monitor.MsrPowerMonitorWin(self)