Skip to content

Commit

Permalink
Allow graphite to flush rrdcached based on a parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Huggins committed Apr 5, 2012
1 parent d038647 commit 72f0117
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webapp/graphite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
join(WEB_DIR, 'templates'),
)

FLUSHRRDCACHED = False

#Pull in overrides from local_settings.py
try:
from graphite.local_settings import *
Expand Down
2 changes: 2 additions & 0 deletions webapp/graphite/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ def fetch(self, startTime, endTime):
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
Expand Down

0 comments on commit 72f0117

Please sign in to comment.