comparison lib/patchablegraph.py @ 1232:b50a13ef20ba

exportStats for sending scales data to influxdb Ignore-this: 715ff40fed97559efa37edf0efa58220 darcs-hash:bcdd9713c4bf9c2ebe732ae1d30edc44f1be704f
author drewp <drewp@bigasterisk.com>
date Sun, 07 Apr 2019 03:56:17 -0700
parents 3d478b05f9b1
children 388769b5f8ff
comparison
equal deleted inserted replaced
1231:996a00d72979 1232:b50a13ef20ba
136 self.masterGraph = masterGraph 136 self.masterGraph = masterGraph
137 137
138 def bind(self): 138 def bind(self):
139 graphJson = self.masterGraph.asJsonLd() 139 graphJson = self.masterGraph.asJsonLd()
140 log.debug("send fullGraph event: %s", graphJson) 140 log.debug("send fullGraph event: %s", graphJson)
141 self.sendEvent(message=graphJson, event='fullGraph') 141 self.sendEvent(message=graphJson, event=b'fullGraph')
142 self.masterGraph.addObserver(self.onPatch) 142 self.masterGraph.addObserver(self.onPatch)
143 143
144 def onPatch(self, patchJson): 144 def onPatch(self, patchJson):
145 # throttle and combine patches here- ideally we could see how 145 # throttle and combine patches here- ideally we could see how
146 # long the latency to the client is to make a better rate choice 146 # long the latency to the client is to make a better rate choice
147 self.sendEvent(message=patchJson, event='patch') 147 self.sendEvent(message=patchJson, event=b'patch')
148 148
149 def unbind(self): 149 def unbind(self):
150 self.masterGraph.removeObserver(self.onPatch) 150 self.masterGraph.removeObserver(self.onPatch)
151 151