mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-03-23 04:05:15 +00:00
web/deep-check: show the webapi runtime at the bottom of the page
This commit is contained in:
parent
7a206421b4
commit
e5252fd5b2
@ -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]
|
||||
|
@ -48,5 +48,7 @@
|
||||
|
||||
<div n:render="return" />
|
||||
|
||||
<div n:render="runtime" />
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user