Skip to content

Commit

Permalink
Merge pull request #327 from filippog/statsd_pipeline
Browse files Browse the repository at this point in the history
statsd: use pystatsd pipeline to send batches
  • Loading branch information
jaingaurav committed Nov 27, 2015
2 parents 2755eda + 48b5cc5 commit e005666
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/diamond/handler/stats_d.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def _send(self):
statsd.Counter(prefix, self.connection).increment(
name, value)

if hasattr(statsd, 'StatsClient'):
self.connection.send()
self.metrics = []

def flush(self):
Expand All @@ -152,7 +154,7 @@ def _connect(self):
self.connection = statsd.StatsClient(
host=self.host,
port=self.port
)
).pipeline()
else:
# Create socket
self.connection = statsd.Connection(
Expand Down

0 comments on commit e005666

Please sign in to comment.