Skip to content

Commit

Permalink
Merge branch 'master' of github.com:brutasse/graphite-api
Browse files Browse the repository at this point in the history
  • Loading branch information
brutasse committed Oct 5, 2015
2 parents f6cf83a + ba8a301 commit 7a70952
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion graphite_api/finders/whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ def fetch(self, startTime, endTime): # noqa
if isinstance(cached_datapoints, dict):
cached_datapoints = cached_datapoints.items()
for timestamp, value in sorted(cached_datapoints):
# filter only to cached datapoints within [start, end)
if not (timestamp >= start and timestamp < end):
continue
interval = timestamp - (timestamp % step)
i = int(interval - start) // step
values[i] = value
Expand All @@ -133,7 +136,7 @@ class GzippedWhisperReader(WhisperReader):
def get_intervals(self):
fh = gzip.GzipFile(self.fs_path, 'rb')
try:
info = whisper.__readHeader(fh) # evil, but necessary.
info = getattr(whisper, '__readHeader')(fh) # evil, but necessary.
finally:
fh.close()

Expand Down

0 comments on commit 7a70952

Please sign in to comment.