mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Add tests for statsd prefix
This commit is contained in:
parent
eb3bf34066
commit
88bc188407
@ -77,3 +77,12 @@ def test_instrument():
|
||||
t.eq(logger.sock.msgs[0], "gunicorn.request.duration:7000.0|ms")
|
||||
t.eq(logger.sock.msgs[1], "gunicorn.requests:1|c|@1.0")
|
||||
t.eq(logger.sock.msgs[2], "gunicorn.request.status.200:1|c|@1.0")
|
||||
|
||||
def test_prefix():
|
||||
c = Config()
|
||||
c.set("statsd_prefix", "test.")
|
||||
logger = Statsd(c)
|
||||
logger.sock = MockSocket(False)
|
||||
|
||||
logger.info("Blah", extra={"mtype": "gauge", "metric": "gunicorn.test", "value": 666})
|
||||
t.eq(logger.sock.msgs[0], "test.gunicorn.test:666|g")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user