From 930ed2c0890d97b4e748d08f8f373bcc082b2163 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 26 Jun 2016 17:16:22 -0700 Subject: [PATCH] server: log get_stats time The DB queries this uses aren't particularly efficient, and when the time it takes to run starts to become a problem, we should do an optimization pass. --- src/wormhole/server/server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wormhole/server/server.py b/src/wormhole/server/server.py index c2baf20..bddf4a4 100644 --- a/src/wormhole/server/server.py +++ b/src/wormhole/server/server.py @@ -125,8 +125,10 @@ class RelayServer(service.MultiService): data["created"] = now data["valid_until"] = now + validity + start = time.time() data["rendezvous"] = self._rendezvous.get_stats() data["transit"] = self._transit.get_stats() + log.msg("get_stats took:", time.time() - start) with open(tmpfn, "wb") as f: json.dump(data, f, indent=1)