changeset 1444:5bd2d036ae74

rdfdb log patch-to-client send times Ignore-this: af10a7e205f559da6a7addd4a0ab93e6
author drewp@bigasterisk.com
date Sat, 11 Jun 2016 21:15:36 +0000
parents dd3f72ac7214
children 6001c86f9fca
files light9/rdfdb/patchsender.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/light9/rdfdb/patchsender.py	Sat Jun 11 21:14:55 2016 +0000
+++ b/light9/rdfdb/patchsender.py	Sat Jun 11 21:15:36 2016 +0000
@@ -103,10 +103,14 @@
     if len(body) > 200:
         intro = intro + "..."
     log.debug("send body (rendered %.1fkB in %.1fms): %s", len(body) / 1024, jsonTime * 1000, intro)
+    sendTime = time.time()
     def putDone(done):
         if not str(done.code).startswith('2'):
-            raise ValueError("sendPatch request failed %s: %s" % (done.code, done.body))
-        log.debug("sendPatch finished, response: %r" % done.body)
+            raise ValueError("sendPatch request failed %s: %s" %
+                             (done.code, done.body))
+        dt = 1000 * (time.time() - sendTime)
+        log.debug("sendPatch to %s took %sms, response: %r" %
+                  (putUri, dt, done.body))
         return done
 
     return cyclone.httpclient.fetch(