From 6c9c9f3a6d1bd77a45f9a9f588cb32211a221719 Mon Sep 17 00:00:00 2001 From: Luis Silva Date: Fri, 1 Apr 2016 14:02:48 -0400 Subject: [PATCH] ensuring new line at the end of each value --- graph_lfs_stats.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/graph_lfs_stats.py b/graph_lfs_stats.py index 6c8db55..1da8a35 100755 --- a/graph_lfs_stats.py +++ b/graph_lfs_stats.py @@ -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) @@ -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)