зеркало из https://github.com/microsoft/statsd.git
examples: python: added sets support
This commit is contained in:
Родитель
18c67ab3f1
Коммит
1857aeed93
|
@ -25,7 +25,6 @@ class StatsdClient(object):
|
|||
>>> client = StatsdClient()
|
||||
>>> client.timing('example.timing', 500)
|
||||
>>> client.timing(('example.timing23', 'example.timing29'), 500)
|
||||
|
||||
"""
|
||||
stats = self.format(stats, time, self.SC_TIMING)
|
||||
self.send(stats, self.addr)
|
||||
|
@ -41,6 +40,17 @@ class StatsdClient(object):
|
|||
stats = self.format(stats, value, self.SC_GAUGE)
|
||||
self.send(stats, self.addr)
|
||||
|
||||
def set(self, stats, value):
|
||||
"""
|
||||
Log set
|
||||
|
||||
>>> client = StatsdClient()
|
||||
>>> client.set('example.set', "set")
|
||||
>>> client.set(('example.set61', 'example.set67'), "2701")
|
||||
"""
|
||||
stats = self.format(stats, value, self.SC_SET)
|
||||
self.send(stats, self.addr)
|
||||
|
||||
def increment(self, stats, sample_rate=1):
|
||||
"""
|
||||
Increments one or more stats counters
|
||||
|
|
Загрузка…
Ссылка в новой задаче