Mercurial > code > home > repos > light9
diff light9/collector/collector_client.py @ 2046:9aa046cc9b33
replace greplin with prometheus throughout (untested)
author | drewp@bigasterisk.com |
---|---|
date | Tue, 10 May 2022 23:01:26 -0700 |
parents | 67575505c400 |
children | ccdfdc8183ad |
line wrap: on
line diff
--- a/light9/collector/collector_client.py Mon May 09 23:18:39 2022 -0700 +++ b/light9/collector/collector_client.py Tue May 10 23:01:26 2022 -0700 @@ -1,20 +1,15 @@ from light9 import networking from light9.effect.settings import DeviceSettings +from light9.metrics import metrics from twisted.internet import defer from txzmq import ZmqEndpoint, ZmqFactory, ZmqPushConnection import json, time, logging import treq -# from greplin import scales log = logging.getLogger('coll_client') _zmqClient = None -# stats = scales.collection( -# '/collectorClient', -# scales.PmfStat('send', recalcPeriod=1), -# ) - class TwistedZmqClient(object): @@ -58,7 +53,7 @@ def onDone(result): dt = time.time() - sendTime - # stats.send = dt + metrics('send').observe(dt) if dt > .1: log.warn('sendToCollector request took %.1fms', dt * 1000) return dt