Server IP : 192.64.112.168 / Your IP : 3.144.100.31 Web Server : Apache System : Linux nc-ph-2300-85.bluforrest.com 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Sat Dec 2 05:23:44 EST 2023 x86_64 User : expressoneac ( 1128) PHP Version : 8.0.30 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python3.6/site-packages/tuned/monitors/ |
Upload File : |
import tuned.logs import tuned.monitors from tuned.utils.plugin_loader import PluginLoader log = tuned.logs.get() __all__ = ["Repository"] class Repository(PluginLoader): def __init__(self): super(Repository, self).__init__() self._monitors = set() @property def monitors(self): return self._monitors def _set_loader_parameters(self): self._namespace = "tuned.monitors" self._prefix = "monitor_" self._interface = tuned.monitors.Monitor def create(self, plugin_name, devices): log.debug("creating monitor %s" % plugin_name) monitor_cls = self.load_plugin(plugin_name) monitor_instance = monitor_cls(devices) self._monitors.add(monitor_instance) return monitor_instance def delete(self, monitor): assert isinstance(monitor, self._interface) monitor.cleanup() self._monitors.remove(monitor)