Mercurial > code > home > repos > homeauto
comparison lib/patchsource.py @ 439:124c921ad52d
stats->state to make room for greplin stats
Ignore-this: cfa2357bdf06ac3324741700ac44db5c
author | drewp@bigasterisk.com |
---|---|
date | Mon, 15 Apr 2019 00:17:04 -0700 |
parents | fcd2c026f51e |
children | 3d51d4b63497 |
comparison
equal
deleted
inserted
replaced
438:d453cdd8a86f | 439:124c921ad52d |
---|---|
39 def sfd(d): | 39 def sfd(d): |
40 origSet(d) | 40 origSet(d) |
41 d.addCallback(self._onDisconnect) | 41 d.addCallback(self._onDisconnect) |
42 self._eventSource.protocol.setFinishedDeferred = sfd | 42 self._eventSource.protocol.setFinishedDeferred = sfd |
43 | 43 |
44 def stats(self): | 44 def state(self): |
45 return { | 45 return { |
46 'url': self.url, | 46 'url': self.url, |
47 'fullGraphReceived': self._fullGraphReceived, | 47 'fullGraphReceived': self._fullGraphReceived, |
48 } | 48 } |
49 | 49 |
125 self._ps.connectionLost.addCallback(self._onConnectionLost) | 125 self._ps.connectionLost.addCallback(self._onConnectionLost) |
126 | 126 |
127 def _onPatch(self, p, fullGraph): | 127 def _onPatch(self, p, fullGraph): |
128 self._listener(p, fullGraph=fullGraph) | 128 self._listener(p, fullGraph=fullGraph) |
129 | 129 |
130 def stats(self): | 130 def state(self): |
131 return { | 131 return { |
132 'reconnectedPatchSource': self._ps.stats(), | 132 'reconnectedPatchSource': self._ps.state(), |
133 } | 133 } |
134 | 134 |
135 def stop(self): | 135 def stop(self): |
136 self._stopped = True | 136 self._stopped = True |
137 self._ps.stop() | 137 self._ps.stop() |