Skip to content

Commit

Permalink
Fixed gcm3 - writing and reading points.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMikita committed Sep 12, 2017
1 parent 5e65df0 commit f219e0c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cloudwrapper/gcm3.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ def read(self, startTime=None, endTime=None, pageSize=10):
).select_interval(
end_time=endTime,
start_time=startTime)
return list(query.iter(page_size=pageSize))
for ts in query.iter(page_size=pageSize):
for p in ts.points:
yield p
except:
return []
pass


def _addPoint(self, value, startTime=None, endTime=None):
Expand Down Expand Up @@ -226,7 +228,7 @@ def write(self, value, startTime=None, endTime=None, metricLabels={}):
labels=metricLabels
)
# Point is dictionary which corresponds with write_points args
for point in self.points():
for point in self.points:
self.client.write_point(metric, resource, **point)
self.points = []
return True
Expand Down

0 comments on commit f219e0c

Please sign in to comment.