diff service/reasoning/patchsource.py @ 1111:aa70001ea0c9

sse_collector stats page Ignore-this: 73b6ac46c87bbcca85e7d1ca9127a61c darcs-hash:102cd65f76f723fb0f0d1b74a035b809daac6895
author drewp <drewp@bigasterisk.com>
date Fri, 16 Sep 2016 01:21:19 -0700
parents e68f6e5712c6
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