-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use higher precision clock measurements for Python 3 #6849
Conversation
Codecov Report
|
os: linux | ||
- checkName: tcp_check | ||
displayName: TCP (Windows) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this due to a specific issue on windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a similar reason we added Windows testing to the dns_check
, time gets handled slightly differently on the two platforms.
from datadog_checks.base import AgentCheck, ConfigurationError | ||
from datadog_checks.base.utils.platform import Platform | ||
|
||
if PY3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move this to some place in the base package (we'd still need to put it here at least for one release)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could be beneficial, but it wouldn't be universal - time.time
is used pretty broadly across the integration checks, but sometimes for actual timestamps vs just performance monitoring.
I can tackle it in a separate PR, though.
What does this PR do?
Use the higher precision clock available in Python 3,
time.perf_counter
. This pattern has been previously adopted as part of #6478 and #6682.Additionally, test this check under Windows CI as well.