diff service/reasoning/patchsource.py @ 306:6aad04b34231

sse_collector stats page Ignore-this: 73b6ac46c87bbcca85e7d1ca9127a61c
author drewp@bigasterisk.com
date Fri, 16 Sep 2016 01:21:19 -0700
parents 46c5fae89823
children 170dc9b1e789
line wrap: on
line diff
--- a/service/reasoning/patchsource.py	Fri Sep 16 01:16:12 2016 -0700
+++ b/service/reasoning/patchsource.py	Fri Sep 16 01:21:19 2016 -0700
@@ -38,6 +38,12 @@
             origSet(d)
             d.addCallback(self._onDisconnect)
         self._eventSource.protocol.setFinishedDeferred = sfd
+
+    def stats(self):
+        return {
+            'url': self.url,
+            'fullGraphReceived': self._fullGraphReceived,
+        }
         
     def addPatchListener(self, func):
         """
@@ -117,6 +123,11 @@
 
     def _onPatch(self, p, fullGraph):
         self._listener(p, fullGraph=fullGraph)
+
+    def stats(self):
+        return {
+            'reconnectedPatchSource': self._ps.stats(),
+        }
         
     def stop(self):
         self._stopped = True