pvl/verkko/rrd.py
changeset 155 9f2967ba81ef
parent 154 11df86fd2d67
child 156 999ae3e9fdec
--- a/pvl/verkko/rrd.py	Sun Jan 20 18:51:51 2013 +0200
+++ b/pvl/verkko/rrd.py	Sun Jan 20 19:52:41 2013 +0200
@@ -19,12 +19,19 @@
         A filesystem directory containing .rrd files.
     """
 
-    def __init__ (self, path, cache=None) :
+    def __init__ (self, graph, path, cache=None) :
+        """
+            graph   - pvl.rrd.graph.InterfaceGraph type
+            path    - path to rrd dirs
+            cache   - path to cache dirs
+        """
+
         if not path :
             raise ValueError("RRDDatabase: no path given")
 
-        log.info("%s: cache=%s", path, cache)
-
+        log.info("%s: type=%s, cache=%s", path, graph, cache)
+        
+        self._graph = graph
         self._path = path
         self._cache = cache
 
@@ -177,9 +184,7 @@
 
         else :
             # to cache
-            # XXX: lookup graph style..
-            # XXX: collectd
-            dimensions, lines, outfile = pvl.rrd.graph.collectd_ifoctets(style, interval, title, path, out)
+            dimensions, lines, outfile = self._graph.build(title, path, style, interval).graph(out)
 
         return outfile