]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
web/deep-check: show the webapi runtime at the bottom of the page
authorBrian Warner <warner@allmydata.com>
Wed, 13 Aug 2008 03:34:26 +0000 (20:34 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 13 Aug 2008 03:34:26 +0000 (20:34 -0700)
src/allmydata/web/checker_results.py
src/allmydata/web/deep-check-results.xhtml
src/allmydata/webish.py

index 532ed23671b31b5f791140c3d92aff3ecfdde71f..370605fa81151df72482dec25e9d2e208fa7f11d 100644 (file)
@@ -1,4 +1,5 @@
 
+import time
 from nevow import rend, inevow, tags as T
 from allmydata.web.common import getxmlfile, get_arg
 from allmydata.interfaces import ICheckerResults, IDeepCheckResults
@@ -72,3 +73,8 @@ class DeepCheckResults(rend.Page):
         if return_to:
             return T.div[T.a(href=return_to)["Return to parent directory"]]
         return ""
+
+    def render_runtime(self, ctx, data):
+        req = inevow.IRequest(ctx)
+        runtime = time.time() - req.processing_started_timestamp
+        return ctx.tag["runtime: %s seconds" % runtime]
index 2f819808df46641c778209f998d98aef265832ac..d4b040bcc7a1dcb49193b01b333094b3f453d814 100644 (file)
@@ -48,5 +48,7 @@
 
 <div n:render="return" />
 
+<div n:render="runtime" />
+
   </body>
 </html>
index 6e7e9316ef7e98a6a3267fba4a1573cf42bf4fc7..ed7173d1fa912d29af7614658b3d703ed106b576 100644 (file)
@@ -1,4 +1,5 @@
 
+import time
 from twisted.application import service, strports, internet
 from twisted.web import http
 from twisted.internet import defer
@@ -75,6 +76,7 @@ class MyRequest(appserver.NevowRequest):
 ##                      self.channel.transport.loseConnection()
 ##                      return
 ##                  raise
+        self.processing_started_timestamp = time.time()
         self.process()
 
     def _logger(self):