]> git.ipfire.org Git - collecty.git/blobdiff - src/collecty/plugins/cpu.py
graph templates: Make some atttibutes easier to set
[collecty.git] / src / collecty / plugins / cpu.py
index c9825b7d2849f2db6dbb3a9392bf58883d56f204..292bf0c797452239350a460935f104578fc40885 100644 (file)
@@ -25,8 +25,8 @@ import base
 
 from ..i18n import _
 
-class GraphTemplateCPU(base.GraphTemplate):
-       name = "cpu"
+class GraphTemplateProcessor(base.GraphTemplate):
+       name = "processor"
 
        rrd_graph = [
                "DEF:user=%(file)s:user:AVERAGE",
@@ -94,12 +94,15 @@ class GraphTemplateCPU(base.GraphTemplate):
                "GPRINT:idleavg:%12s\:" % _("Average") + " %6.2lf\\n",
        ]
 
-       rrd_graph_args = [
-               "--title", _("CPU usage"),
-               "--vertical-label", _("Jiffies"),
+       lower_limit = 0
 
-               "--lower-limit", "0", "--rigid",
-       ]
+       @property
+       def graph_title(self):
+               return _("CPU usage")
+
+       @property
+       def graph_vertical_label(self):
+               return _("Jiffies")
 
 
 class ProcessorObject(base.Object):
@@ -154,7 +157,7 @@ class ProcessorPlugin(base.Plugin):
        name = "processor"
        description = "Processor Usage Plugin"
 
-       templates = [GraphTemplateCPU,]
+       templates = [GraphTemplateProcessor]
 
        interval = 30