[MediaWiki-commits] [Gerrit] Revert "txstatsd: add support for graphite line-protocol" - change (operations...txstatsd)

2015-01-06 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: Revert "txstatsd: add support for graphite line-protocol"
..


Revert "txstatsd: add support for graphite line-protocol"

This reverts commit 0489dc65e315c0ef7886ee5d522f76599a4b9862.

Change-Id: Ia826bd81060e6242e6d7354c42599608924c6290
---
M txstatsd.conf-example
M txstatsd/service.py
2 files changed, 1 insertion(+), 30 deletions(-)

Approvals:
  Filippo Giunchedi: Verified; Looks good to me, approved



diff --git a/txstatsd.conf-example b/txstatsd.conf-example
index 53eef1d..1119fa9 100644
--- a/txstatsd.conf-example
+++ b/txstatsd.conf-example
@@ -5,8 +5,6 @@
 carbon-cache-port: 2003
 # The UDP port where we will listen.
 listen-port: 8125
-# Write metrics using graphite's line-oriented protocol instead of pickle
-use-line-protocol: 0
 
 # The number of milliseconds between each flush.
 flush-interval: 6
@@ -25,4 +23,4 @@
 monitor-response: txstatsd pong
 
 [plugin_sample]
-sample-key: sample-value
+sample-key: sample-value
\ No newline at end of file
diff --git a/txstatsd/service.py b/txstatsd/service.py
index bc77694..f8721d7 100644
--- a/txstatsd/service.py
+++ b/txstatsd/service.py
@@ -156,8 +156,6 @@
  "The port where carbon cache is listening.", int],
 ["carbon-cache-name", "n", None,
  "An identifier for the carbon-cache instance."],
-["use-line-protocol", "P", 0,
- "Use graphite line protocol when sending metrics."],
 ["listen-port", "l", 8125,
  "The UDP port where we will listen.", int],
 ["flush-interval", "i", 6,
@@ -254,23 +252,6 @@
 return current_stats
 
 
-def _CarbonClientLineProtocol_sendDatapoints(self, datapoints):
-"""Serialize data in line (or plaintext) format, one metric per line."""
-def _serialize(data):
-return "".join("%s %s %s\n" % (x, y[1], y[0]) for x, y in data)
-
-from carbon import instrumentation
-self.sendString(_serialize(datapoints))
-instrumentation.increment(self.sent, len(datapoints))
-self.factory.checkQueue()
-
-
-def _Int32StringReceiver_sendString(self, string):
-"""Write data verbatim to the transport, StringReceiver standard
-   implementation would length-prefix the string instead."""
-self.transport.write(string)
-
-
 def createService(options):
 """Create a txStatsD service."""
 from carbon.routers import ConsistentHashingRouter
@@ -349,14 +330,6 @@
 for reporter in getattr(process, "%s_STATS" %
 report_name.upper(), ()):
 reporting.schedule(reporter, 60, metrics.gauge)
-
-# monkey-patch line protocol sending function :(
-if options["use-line-protocol"]:
-import carbon.client
-carbon.client.CarbonClientProtocol._sendDatapoints = \
-_CarbonClientLineProtocol_sendDatapoints
-carbon.client.CarbonClientProtocol.sendString = \
-_Int32StringReceiver_sendString
 
 # XXX Make this configurable.
 router = ConsistentHashingRouter()

-- 
To view, visit https://gerrit.wikimedia.org/r/183057
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia826bd81060e6242e6d7354c42599608924c6290
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/txstatsd
Gerrit-Branch: master
Gerrit-Owner: Filippo Giunchedi 
Gerrit-Reviewer: Filippo Giunchedi 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Revert "txstatsd: add support for graphite line-protocol" - change (operations...txstatsd)

2015-01-06 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/183057

Change subject: Revert "txstatsd: add support for graphite line-protocol"
..

Revert "txstatsd: add support for graphite line-protocol"

This reverts commit 0489dc65e315c0ef7886ee5d522f76599a4b9862.

Change-Id: Ia826bd81060e6242e6d7354c42599608924c6290
---
M txstatsd.conf-example
M txstatsd/service.py
2 files changed, 1 insertion(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/txstatsd 
refs/changes/57/183057/1

diff --git a/txstatsd.conf-example b/txstatsd.conf-example
index 53eef1d..1119fa9 100644
--- a/txstatsd.conf-example
+++ b/txstatsd.conf-example
@@ -5,8 +5,6 @@
 carbon-cache-port: 2003
 # The UDP port where we will listen.
 listen-port: 8125
-# Write metrics using graphite's line-oriented protocol instead of pickle
-use-line-protocol: 0
 
 # The number of milliseconds between each flush.
 flush-interval: 6
@@ -25,4 +23,4 @@
 monitor-response: txstatsd pong
 
 [plugin_sample]
-sample-key: sample-value
+sample-key: sample-value
\ No newline at end of file
diff --git a/txstatsd/service.py b/txstatsd/service.py
index bc77694..f8721d7 100644
--- a/txstatsd/service.py
+++ b/txstatsd/service.py
@@ -156,8 +156,6 @@
  "The port where carbon cache is listening.", int],
 ["carbon-cache-name", "n", None,
  "An identifier for the carbon-cache instance."],
-["use-line-protocol", "P", 0,
- "Use graphite line protocol when sending metrics."],
 ["listen-port", "l", 8125,
  "The UDP port where we will listen.", int],
 ["flush-interval", "i", 6,
@@ -254,23 +252,6 @@
 return current_stats
 
 
-def _CarbonClientLineProtocol_sendDatapoints(self, datapoints):
-"""Serialize data in line (or plaintext) format, one metric per line."""
-def _serialize(data):
-return "".join("%s %s %s\n" % (x, y[1], y[0]) for x, y in data)
-
-from carbon import instrumentation
-self.sendString(_serialize(datapoints))
-instrumentation.increment(self.sent, len(datapoints))
-self.factory.checkQueue()
-
-
-def _Int32StringReceiver_sendString(self, string):
-"""Write data verbatim to the transport, StringReceiver standard
-   implementation would length-prefix the string instead."""
-self.transport.write(string)
-
-
 def createService(options):
 """Create a txStatsD service."""
 from carbon.routers import ConsistentHashingRouter
@@ -349,14 +330,6 @@
 for reporter in getattr(process, "%s_STATS" %
 report_name.upper(), ()):
 reporting.schedule(reporter, 60, metrics.gauge)
-
-# monkey-patch line protocol sending function :(
-if options["use-line-protocol"]:
-import carbon.client
-carbon.client.CarbonClientProtocol._sendDatapoints = \
-_CarbonClientLineProtocol_sendDatapoints
-carbon.client.CarbonClientProtocol.sendString = \
-_Int32StringReceiver_sendString
 
 # XXX Make this configurable.
 router = ConsistentHashingRouter()

-- 
To view, visit https://gerrit.wikimedia.org/r/183057
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia826bd81060e6242e6d7354c42599608924c6290
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/txstatsd
Gerrit-Branch: master
Gerrit-Owner: Filippo Giunchedi 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits