diff options
author | Philip Knirsch <pknirsch@hamburg.stuttgart.redhat.com> | 2009-02-25 11:28:06 +0100 |
---|---|---|
committer | Philip Knirsch <pknirsch@hamburg.stuttgart.redhat.com> | 2009-02-25 11:28:06 +0100 |
commit | 1fa57228447abc46d58bcc377ab373c026ccd008 (patch) | |
tree | 634135e6c1c62729feb2893a38d7b2da0d89784e /tuningplugins | |
parent | e393e728bcffd730401780a8fb3d077d952fed78 (diff) | |
download | tuned-1fa57228447abc46d58bcc377ab373c026ccd008.tar.gz tuned-1fa57228447abc46d58bcc377ab373c026ccd008.tar.xz tuned-1fa57228447abc46d58bcc377ab373c026ccd008.zip |
- Add init() methods to each plugin
- Call plugin init() methods during tuned's init()
- Add support for command line parameters
o -c conffile|--config==conffile to specify the location of the config file
o -d to start tuned as a daemon (instead of as normal app)
- Readded the debug output in case tuned isn't started as as daemon
- Fixed initialization of max transfer values for net tuning plugin
Diffstat (limited to 'tuningplugins')
-rw-r--r-- | tuningplugins/disk.py | 5 | ||||
-rw-r--r-- | tuningplugins/net.py | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/tuningplugins/disk.py b/tuningplugins/disk.py index 9d7d848..6624890 100644 --- a/tuningplugins/disk.py +++ b/tuningplugins/disk.py @@ -33,6 +33,9 @@ class DiskTuning: idle.setdefault(type, 0) idle[type] = 0 + def init(self, config): + self.config = config + def setTuning(self, load): disks = load.setdefault("DISK", {}) for dev in disks.keys(): @@ -44,6 +47,6 @@ class DiskTuning: if self.devidle[dev]["LEVEL"] > 0 and (self.devidle[dev]["READ"] == 0 or self.devidle[dev]["WRITE"] == 0): self.devidle[dev]["LEVEL"] = 0 os.system("hdparm -S255 -B127 /dev/"+dev) - #print(load, self.devidle) + print(load, self.devidle) _plugin = DiskTuning() diff --git a/tuningplugins/net.py b/tuningplugins/net.py index 3983b8d..687d306 100644 --- a/tuningplugins/net.py +++ b/tuningplugins/net.py @@ -33,6 +33,9 @@ class NetTuning: idle.setdefault(type, 0) idle[type] = 0 + def init(self, config): + self.config = config + def setTuning(self, load): disks = load.setdefault("NET", {}) for dev in disks.keys(): @@ -44,6 +47,6 @@ class NetTuning: if self.devidle[dev]["LEVEL"] > 0 and (self.devidle[dev]["READ"] == 0 or self.devidle[dev]["WRITE"] == 0): self.devidle[dev]["LEVEL"] = 0 os.system("ethtool -s "+dev+" advertise 0x03F") - #print(load, self.devidle) + print(load, self.devidle) _plugin = NetTuning() |