]> git.ipfire.org Git - collecty.git/blobdiff - src/collecty/plugins/memory.py
graph templates: Make some atttibutes easier to set
[collecty.git] / src / collecty / plugins / memory.py
index b58cbca5b0ffb104b526908f9f2b6d5a2fe61c18..7fcf1154b2444dd81cf7472cf178a66b2f91940e 100644 (file)
@@ -28,6 +28,9 @@ from ..i18n import _
 class GraphTemplateMemory(base.GraphTemplate):
        name = "memory"
 
+       upper_limit = 100
+       lower_limit = 0
+
        rrd_graph = [
                "DEF:used=%(file)s:used:AVERAGE",
                "DEF:cached=%(file)s:cached:AVERAGE",
@@ -76,15 +79,13 @@ class GraphTemplateMemory(base.GraphTemplate):
                "GPRINT:swapavg:%12s\:" % _("Average") + " %6.2lf\\n",
        ]
 
-       rrd_graph_args = [
-               "--title", _("Memory Usage"),
-               "--vertical-label", _("Percent"),
+       @property
+       def graph_title(self):
+               return _("Memory Usage")
 
-               # Limit y axis.
-               "--upper-limit", "100",
-               "--lower-limit", "0",
-               "--rigid",
-       ]
+       @property
+       def graph_vertical_label(self):
+               return _("Percent")
 
 
 class MemoryObject(base.Object):
@@ -141,7 +142,7 @@ class MemoryPlugin(base.Plugin):
        name = "memory"
        description = "Memory Usage Plugin"
 
-       templates = [GraphTemplateMemory,]
+       templates = [GraphTemplateMemory]
 
        @property
        def objects(self):