]> git.proxmox.com Git - pve-cluster.git/commitdiff
create_rrd_graph: do not save data in file
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 31 Oct 2012 06:03:06 +0000 (07:03 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 31 Oct 2012 06:12:36 +0000 (07:12 +0100)
We use RRDs::graphv instead, and return file data directly.

Makefile
data/PVE/Cluster.pm
debian/changelog

index ca059db61b341686c92ed8c58130a99f94562b6e..2d5cd810824a2d13523f27a7c3f617b3c48feb3f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ RELEASE=2.2
 
 PACKAGE=pve-cluster
 PKGVER=1.0
-PKGREL=28
+PKGREL=29
 
 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
 
index cd9d192499c56013d563e792ee5aac2e808c4d7c..624d1e88a538bde86564db5f307f2742c6acb2fc 100644 (file)
@@ -670,7 +670,11 @@ sub create_rrd_graph {
 
     my $rrd = "$rrddir/$rrdname";
 
-    my $filename = "$rrd.png";
+    my @ids = PVE::Tools::split_list($ds);
+
+    my $ds_txt = join('_', @ids);
+
+    my $filename = "${rrd}_${ds_txt}.png";
 
     my $setup = {
        hour =>  [ 60, 60 ],
@@ -694,8 +698,6 @@ sub create_rrd_graph {
     my $socket = "/var/run/rrdcached.sock";
     push @args, "--daemon" => "unix:$socket" if -S $socket;
 
-    my @ids = PVE::Tools::split_list($ds);
-
     my @coldef = ('#00ddff', '#ff0000');
 
     $cf = "AVERAGE" if !$cf;
@@ -714,12 +716,13 @@ sub create_rrd_graph {
 
     push @args, '--full-size-mode';
 
-    RRDs::graph($filename, @args);
+    # we do not really store data into the file
+    my $res = RRDs::graphv(undef, @args);
 
     my $err = RRDs::error;
     die "RRD error: $err\n" if $err;
 
-    return { filename => $filename };
+    return { filename => $filename, image => $res->{image} };
 }
 
 # a fast way to read files (avoid fuse overhead)
index aee4b212c4932ee0f95a331d879c74105e4e9e9d..5b043e86bcb64c019632ab6bdfc36bda27ba97cc 100644 (file)
@@ -1,3 +1,9 @@
+pve-cluster (1.0-29) unstable; urgency=low
+
+  * fix caching problems in create_rrd_graph (do not save any data to files)
+
+ -- Proxmox Support Team <support@proxmox.com>  Wed, 31 Oct 2012 07:12:10 +0100
+
 pve-cluster (1.0-28) unstable; urgency=low
 
   * preserve authorized_key key order