]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_p2p/interfaces.py
Display DHT statistics to the HTTP user.
[quix0rs-apt-p2p.git] / apt_p2p / interfaces.py
index b38de39b016738bb0bc79235e44a57657b7d7858..f72cd8e23afa20cc07db24717a427d9e813d92af 100644 (file)
@@ -41,3 +41,26 @@ class IDHT(Interface):
 
         The length of the key may be adjusted for use with the DHT.
         """
+
+class IDHTStats(Interface):
+    """An abstract interface for DHTs that support statistics gathering."""
+    
+    def getStats(self):
+        """Gather and format all the statistics for the DHT.
+        
+        The statistics will be formatted for inclusion in the body
+        of an HTML page.
+        
+        @rtype: C{string}
+        @return: the formatted statistics, suitable for displaying to the user
+        """
+    
+class IDHTStatsFactory(Interface):
+    """An abstract interface for DHTs that support statistics displaying."""
+    
+    def getStatsFactory(self):
+        """Create and return an HTTP factory for displaying statistics.
+        
+        @rtype: 
+        """
+        
\ No newline at end of file