From 92ea8646b855716b444418b5224ebcf5ac4e7903 Mon Sep 17 00:00:00 2001 From: mohansriharsha Date: Thu, 16 May 2019 16:44:51 +0530 Subject: [PATCH] add serialize to total kwikapi timings --- .travis.yml | 4 ++-- kwikapi/api.py | 4 ++-- setup.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce11ea5..43132fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,8 @@ deploy: - LICENSE - kwikapi/api.py - kwikapi/__init__.py - name: kwikapi-0.5.7 - tag_name: 0.5.7 + name: kwikapi-0.5.8 + tag_name: 0.5.8 on: repo: deep-compute/kwikapi - provider: pypi diff --git a/kwikapi/api.py b/kwikapi/api.py index 45fbe8b..2cf2d6a 100644 --- a/kwikapi/api.py +++ b/kwikapi/api.py @@ -546,8 +546,6 @@ def handle_request(self, request): tcompute = time.time() - tcompute - response.headers[TIMING_HEADER] = str(tcompute) - # Serialize the response if request.fn.__func__.func_info['gives_stream']: result = self._wrap_stream(request, result) if protocol.should_wrap() else result @@ -556,6 +554,8 @@ def handle_request(self, request): result = dict(success=True, result=result) if protocol.should_wrap() else result n, t = response.write(result, protocol) + response.headers[TIMING_HEADER] = str(tcompute + t.value) + request.log.info('kwikapi.handle_request', function=rinfo.function, namespace=rinfo.namespace, method=rinfo.method, compute_time=tcompute, serialize_time=t.value, diff --git a/setup.py b/setup.py index 486c40b..b6e3778 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.5.7' +version = '0.5.8' setup( name="kwikapi", version=version,