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

Time to complete the request is not correct if the request itself took more than one second #15

Open
tisnik opened this issue Feb 27, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@tisnik
Copy link
Member

tisnik commented Feb 27, 2019

response_time = self.datediff_in_millisecs(started_at, ended_at)

According to the documentation:

A timedelta object represents a duration, the difference between two dates or times.

Only days, seconds and microseconds are stored internally. Arguments are converted to those units:

A millisecond is converted to 1000 microseconds.
A minute is converted to 60 seconds.
An hour is converted to 3600 seconds.
A week is converted to 7 days.

and days, seconds and microseconds are then normalized so that the representation is unique, with

0 <= microseconds < 1000000
0 <= seconds < 3600*24 (the number of seconds in one day)
-999999999 <= days <= 999999999

The problem is, that we use microsecond, and divide it by 1000000 - that's all, no other attributes are used in the computation.

@tisnik tisnik added the bug Something isn't working label Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant