Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix python typo issue

  • Loading branch information...
commit 16f67fd70c68ac9eb3d2a237a1c8aa5922270f4a 1 parent 7c3f654
Yangming authored
Showing with 17 additions and 5 deletions.
  1. +15 −3 python/afclient.py
  2. +2 −2 python/client.py
View
18 python/afclient.py
@@ -135,8 +135,20 @@ def __str__(self):
if __name__ == "__main__":
# import time
Statsd.set_transport(AFTransport(verbosity=True))
+ max_count = 1000000
count = 1
+ @Statsd.count("python.test.count")
+ @Statsd.time("python.test.time")
+ def do_nothing():
+ Statsd.timing("python.test.timer",500)
+ Statsd.gauge("python.test.gauge",500)
+ Statsd.increment("python.test.counter")
+ Statsd.decrement("python.test.counter")
+ Statsd.update_stats("python.test.counter", 5, sample_rate=1, message="ok")
+ Statsd.update_stats("python.test.counter", -5, sample_rate=0)
while True:
- Statsd.increment("mqtest")
- print "send mqtest %s" % count
- count += 1
+ if max_count and count >= max_count:
+ break
+ do_nothing()
+# print "count %s" % count
+ count += 1
View
4 python/client.py
@@ -116,11 +116,11 @@ def __init__(self, bucket):
self.count = 0
def __str__(self):
- avg = self.sumstat/self.count;
+ avg = self.summstat/self.count;
if self.message:
return "%s|ms||%s" % (avg, self.message)
else:
- return "%s|ms" % self.stat
+ return "%s|ms" % avg
def aggregate(self, stat, message=None):
self.summstat += stat

0 comments on commit 16f67fd

Please sign in to comment.
Something went wrong with that request. Please try again.