Skip to content

Commit

Permalink
ensuring new line at the end of each value
Browse files Browse the repository at this point in the history
  • Loading branch information
luisilva committed Apr 1, 2016
1 parent ad03851 commit 6c9c9f3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions graph_lfs_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,9 @@ def push_to_graphite(self):
params = (graphite_service_name, self.datacenter, self.hostname, metric)
gurl = dots.join(params)
logger.debug("parameter strick getting sent to graphite: %s" %gurl)
data_str = '%s %s %s' %(gurl, value, self.epoch_time)
data_str = '%s %s %s\n' %(gurl, value, self.epoch_time)
content.append(data_str)

content = "\n ".join(content)
content = "".join(content)
logger.debug("<<< Opening Connection >>>")
logger.debug("Pushing data: \n %s" %content)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Expand All @@ -376,14 +375,14 @@ def push_oss_to_graphite(self):
for metric, value in dicts.iteritems():
params = (graphite_service_name, self.datacenter, self.hostname, metric)
gurl = dots.join(params)
data = '%s %s %s' %(gurl, value, self.epoch_time)
data = '%s %s %s\n' %(gurl, value, self.epoch_time)
#print data
if type(data) is UnicodeType:
#print type(data)
data = str(data)
#print data
content.append(data)
content = "\n ".join(content)
content = "".join(content)
logger.debug("<<< Opening Connection >>>")
logger.debug("Pushing data: \n %s" %content)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Expand Down

0 comments on commit 6c9c9f3

Please sign in to comment.