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)
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
.__init__.pyo.40009 | File | 208 B | 0644 |
|
.monitor_disk.pyo.40009 | File | 1.89 KB | 0644 |
|
.monitor_load.pyo.40009 | File | 1.01 KB | 0644 |
|
.monitor_net.pyo.40009 | File | 1.96 KB | 0644 |
|
__init__.py | File | 46 B | 0644 |
|
__init__.pyc | File | 208 B | 0644 |
|
__init__.pyo | File | 208 B | 0644 |
|
base.py | File | 2.85 KB | 0644 |
|
base.pyc | File | 5.2 KB | 0644 |
|
base.pyo | File | 4.99 KB | 0644 |
|
monitor_disk.py | File | 886 B | 0644 |
|
monitor_disk.pyc | File | 1.89 KB | 0644 |
|
monitor_disk.pyo | File | 1.89 KB | 0644 |
|
monitor_load.py | File | 306 B | 0644 |
|
monitor_load.pyc | File | 1.01 KB | 0644 |
|
monitor_load.pyo | File | 1.01 KB | 0644 |
|
monitor_net.py | File | 1.14 KB | 0644 |
|
monitor_net.pyc | File | 1.96 KB | 0644 |
|
monitor_net.pyo | File | 1.96 KB | 0644 |
|
repository.py | File | 831 B | 0644 |
|
repository.pyc | File | 1.92 KB | 0644 |
|
repository.pyo | File | 1.86 KB | 0644 |
|