← Back to team overview

graphite-dev team mailing list archive

[Merge] lp:~shufgy/graphite/graphite-rrdcached into lp:graphite

 

Simon Huggins has proposed merging lp:~shufgy/graphite/graphite-rrdcached into lp:graphite.

Requested reviews:
  graphite-dev (graphite-dev)

For more details, see:
https://code.launchpad.net/~shufgy/graphite/graphite-rrdcached/+merge/100973

Allow graphite to flush rrdcached based on a parameter

For anyone exposing RRD files to graphite but using rrdcache this is pretty necessary and thankfully a tiny fix.
-- 
https://code.launchpad.net/~shufgy/graphite/graphite-rrdcached/+merge/100973
Your team graphite-dev is requested to review the proposed merge of lp:~shufgy/graphite/graphite-rrdcached into lp:graphite.
=== modified file 'webapp/graphite/settings.py'
--- webapp/graphite/settings.py	2012-03-17 10:18:50 +0000
+++ webapp/graphite/settings.py	2012-04-05 13:56:33 +0000
@@ -114,6 +114,8 @@
   join(WEB_DIR, 'templates'),
 )
 
+FLUSHRRDCACHED = False
+
 #Pull in overrides from local_settings.py
 try:
   from graphite.local_settings import *

=== modified file 'webapp/graphite/storage.py'
--- webapp/graphite/storage.py	2012-01-28 06:25:18 +0000
+++ webapp/graphite/storage.py	2012-04-05 13:56:33 +0000
@@ -358,6 +358,8 @@
     startString = time.strftime("%H:%M_%Y%m%d+%Ss", time.localtime(startTime))
     endString = time.strftime("%H:%M_%Y%m%d+%Ss", time.localtime(endTime))
 
+    if settings.FLUSHRRDCACHED:
+      rrdtool.flushcached(self.fs_path, '--daemon', settings.FLUSHRRDCACHED)
     (timeInfo,columns,rows) = rrdtool.fetch(self.fs_path,'AVERAGE','-s' + startString,'-e' + endString)
     colIndex = list(columns).index(self.name)
     rows.pop() #chop off the latest value because RRD returns crazy last values sometimes