mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Tested with mainline statsd
This commit is contained in:
parent
9b5d28767c
commit
d21692456b
@ -107,27 +107,27 @@ class Statsd(Logger):
|
||||
def gauge(self, name, value):
|
||||
try:
|
||||
if self.sock:
|
||||
self.sock.send("{0}:{1}|g\n".format(name, value))
|
||||
self.sock.send("{0}:{1}|g".format(name, value))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def increment(self, name, value, sampling_rate=1.0):
|
||||
try:
|
||||
if self.sock:
|
||||
self.sock.send("{0}:{1}|c|@{2}\n".format(name, value, sampling_rate))
|
||||
self.sock.send("{0}:{1}|c|@{2}".format(name, value, sampling_rate))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def decrement(self, name, value, sampling_rate=1.0):
|
||||
try:
|
||||
if self.sock:
|
||||
self.sock.send("{0}:-{1}|c|@{2}\n".format(name, value, sampling_rate))
|
||||
self.sock.send("{0}:-{1}|c|@{2}".format(name, value, sampling_rate))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def histogram(self, name, value, sampling_rate=1.0):
|
||||
try:
|
||||
if self.sock:
|
||||
self.sock.send("{0}:{1}|h\n".format(name, value, sampling_rate))
|
||||
self.sock.send("{0}:{1}|ms".format(name, value, sampling_rate))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user