added scheduler code
This commit is contained in:
+8
-5
@@ -9,18 +9,21 @@ class Governor(AppClass):
|
||||
super().__init__(_config)
|
||||
|
||||
@cached_property
|
||||
def cpufreq(self) -> cpuFreq:
|
||||
def _cpufreq(self) -> cpuFreq:
|
||||
return cpuFreq()
|
||||
|
||||
def set_governor(self, governor_name: str) -> None:
|
||||
self.log.debug("setting governor to %s by using command self.cpufreq.set_governors(%s)", governor_name)
|
||||
self.log.debug(
|
||||
"setting cpu governor to %s by using command self._cpufreq.set_governors(%s)",
|
||||
governor_name, governor_name
|
||||
)
|
||||
|
||||
if self._config.testmode:
|
||||
self.log.warning("application is running in testmode, governor not set")
|
||||
self.log.warning("application is running in testmode, cpu governor not set")
|
||||
return None
|
||||
|
||||
if governor_name not in self.cpufreq.available_governors:
|
||||
if governor_name not in self._cpufreq.available_governors:
|
||||
self.log.error("governor %s not supported by cpu", governor_name)
|
||||
return None
|
||||
|
||||
self.cpufreq.set_governors(governor_name)
|
||||
self._cpufreq.set_governors(governor_name)
|
||||
|
||||
Reference in New Issue
Block a user