Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way in response to fetch the response completion timestamp. #23

Open
prat0318 opened this issue Sep 24, 2015 · 0 comments
Open

Comments

@prat0318
Copy link
Contributor

It is sometimes necessary to find the time taken by the client call, but finding it for an async call is hard at application level because the response might have come much before the result() inspection is done.

I propose adding another param to Response ctor here:

self.finish_timestamp = time.time()

Which can then be read by application logic, eg. :

>>> client = SwaggerClient.from_url("http://localhost:12343/swagger.json", FidoClient())
>>> a = client.hours.getHours(biz_id=1)
>>> time.time()
1443127426.439981
>>> a.future.result().finish_timestamp
1443127423.185333

Which shows that finish_timestamp was recorded before result() (the blocking call) was called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant