annotate light9/collector/collector_client.py @ 2287:62b832e9aac5

use zmq pubsub between clients and collector
author drewp@bigasterisk.com
date Mon, 29 May 2023 21:31:41 -0700
parents ccdfdc8183ad
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1830
8e0e5b3db301 redo collector client to use HTTP
drewp@bigasterisk.com
parents:
diff changeset
1 from light9 import networking
8e0e5b3db301 redo collector client to use HTTP
drewp@bigasterisk.com
parents:
diff changeset
2 from light9.effect.settings import DeviceSettings
2046
9aa046cc9b33 replace greplin with prometheus throughout (untested)
drewp@bigasterisk.com
parents: 2043
diff changeset
3 from light9.metrics import metrics
1830
8e0e5b3db301 redo collector client to use HTTP
drewp@bigasterisk.com
parents:
diff changeset
4 from twisted.internet import defer
8e0e5b3db301 redo collector client to use HTTP
drewp@bigasterisk.com
parents:
diff changeset
5 from txzmq import ZmqEndpoint, ZmqFactory, ZmqPushConnection
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1830
diff changeset
6 import json, time, logging
1830
8e0e5b3db301 redo collector client to use HTTP
drewp@bigasterisk.com
parents:
diff changeset
7 import treq
8e0e5b3db301 redo collector client to use HTTP
drewp@bigasterisk.com
parents:
diff changeset
8
8e0e5b3db301 redo collector client to use HTTP
drewp@bigasterisk.com
parents:
diff changeset
9 log = logging.getLogger('coll_client')
8e0e5b3db301 redo collector client to use HTTP
drewp@bigasterisk.com
parents:
diff changeset
10
1858
7772cc48e016 reformat all python
drewp@bigasterisk.com
parents: 1830
diff changeset
11
2287
62b832e9aac5 use zmq pubsub between clients and collector
drewp@bigasterisk.com
parents: 2187
diff changeset
12 # d = treq.put(networking.collector.path('attrs'), data=msg, timeout=1)