Exemple #1
0
  def report_temperature_critical(self, keyname):
    """Report temperature at which we will see throttling with given keyname.

    @param keyname: key to be used when reporting perf value.
    """
    temperature = utils.get_temperature_critical()
    logging.info('%s = %f degree Celsius', keyname, temperature)
    self.output_perf_value(description=keyname, value=temperature,
                           units='Celsius', higher_is_better=False)
Exemple #2
0
 def __init__(self):
     self._service_stopper = None
     # Keep a copy of the current state for cleanup.
     self._temperature_init = utils.get_current_temperature_max()
     self._temperature_critical = utils.get_temperature_critical()
     self._original_governors = utils.set_high_performance_mode()
     self._error_reason = None
     if not utils.wait_for_idle_cpu(60.0, 0.1):
         self._error_reason = 'Could not get idle CPU.'
         return
     if not utils.wait_for_cool_machine():
         self._error_reason = 'Could not get cold machine.'
         return
     self._temperature_cold = utils.get_current_temperature_max()
     self._temperature_max = self._temperature_cold
     threading.Thread(target=self._monitor_performance_state).start()
     # Should be last just in case we had a runaway process.
     self._stop_thermal_throttling()