diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-05-08 19:31:49 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-05-08 19:32:34 +0200 |
commit | 23d78c4dd01bc74ba35db3e3df95280f6f1b2e22 (patch) | |
tree | 889c2780e2ca493a5daedf72326b2f614460dab9 /test/functional | |
parent | f4b15e2de97c4f8cdbb40bef4c9d0ab2807974d9 (diff) | |
parent | 20187e4ad04f52d7576dd918a6ee5a98447d235e (diff) |
Merge #10352: test: Add elapsed time to RPC tracing
20187e4 test: Add elapsed time to RPC tracing (Wladimir J. van der Laan)
Tree-SHA512: f271acedd14020cf911711577f6dd940850fa84d2577618af06a2247c940fcc5b339a86c1c7a179899c556d217a6c967c785fb311bba43a9b6073cbe470b6737
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/test_framework/authproxy.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/functional/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py index 9ab3094b06..dfcc524313 100644 --- a/test/functional/test_framework/authproxy.py +++ b/test/functional/test_framework/authproxy.py @@ -42,6 +42,7 @@ import decimal import json import logging import socket +import time try: import urllib.parse as urlparse except ImportError: @@ -163,6 +164,7 @@ class AuthServiceProxy(object): return self._request('POST', self.__url.path, postdata.encode('utf-8')) def _get_response(self): + req_start_time = time.time() try: http_response = self.__conn.getresponse() except socket.timeout as e: @@ -183,8 +185,9 @@ class AuthServiceProxy(object): responsedata = http_response.read().decode('utf8') response = json.loads(responsedata, parse_float=decimal.Decimal) + elapsed = time.time() - req_start_time if "error" in response and response["error"] is None: - log.debug("<-%s- %s"%(response["id"], json.dumps(response["result"], default=EncodeDecimal, ensure_ascii=self.ensure_ascii))) + log.debug("<-%s- [%.6f] %s"%(response["id"], elapsed, json.dumps(response["result"], default=EncodeDecimal, ensure_ascii=self.ensure_ascii))) else: - log.debug("<-- "+responsedata) + log.debug("<-- [%.6f] %s"%(elapsed,responsedata)) return response |