Skip to content

Commit

Permalink
Explicitly check for ganglia transport option. This allows transport …
Browse files Browse the repository at this point in the history
…= None, for example. In combination with debug mode, this allows running the server in 'dry' mode, which is useful for testing statsd clients without a Graphite server available.
  • Loading branch information
nzjess committed Dec 27, 2011
1 parent eda9e80 commit d2edccc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pystatsd/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def flush(self):

if self.transport == 'graphite':
stat_string = ''
else:
elif self.transport == 'ganglia':
g = gmetric.Gmetric(self.ganglia_host, self.ganglia_port, self.ganglia_protocol)

for k, v in self.counters.items():
Expand All @@ -115,7 +115,7 @@ def flush(self):
if self.transport == 'graphite':
msg = '%s.%s %s %s\n' % (self.counters_prefix, k, v, ts)
stat_string += msg
else:
elif self.transport == 'ganglia':
# We put counters in _counters group. Underscore is to make sure counters show up
# first in the GUI. Change below if you disagree
g.send(k, v, "double", "count", "both", 60, self.dmax, "_counters", self.ganglia_spoof_host)
Expand Down Expand Up @@ -159,7 +159,7 @@ def flush(self):
'ts': ts,
}

else:
elif self.transport == 'ganglia':
# What group should these metrics be in. For the time being we'll set it to the name of the key
group = k
g.send(k + "_lower", min, "double", "time", "both", 60, self.dmax, group, self.ganglia_spoof_host)
Expand Down

0 comments on commit d2edccc

Please sign in to comment.