-
Notifications
You must be signed in to change notification settings - Fork 412
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
chore(internal): remove time functions from compat module #10861
base: main
Are you sure you want to change the base?
Conversation
|
Datadog ReportBranch report: ✅ 0 Failed, 1286 Passed, 0 Skipped, 30m 26.15s Total duration (7m 36.62s time saved) |
BenchmarksBenchmark execution time: 2024-10-08 08:35:18 Comparing candidate commit c1bc500 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 371 metrics, 53 unstable metrics. |
…raujo/remove-compat-time-ns
@@ -1,9 +1,9 @@ | |||
from datetime import datetime | |||
import time |
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.
nit: Maybe? Not sure if this was intentional for some reason
import time | |
from time import monotonic |
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's what I meant to ask here, if we should change all instances of monotonic
or just that one, but I think the question was misunderstood. Should I go ahead and change all?
This PR removes 4 time-related functions from
ddtrace.internal.compat
that existed for compatibility with Python < 3.7, and replaces all uses with the corresponding functions from the builtintime
module:time_ns
,monotonic
,monotonic_ns
,process_time_ns
.The original motivation for this was noticing that the fallback code for
time_ns
had the wrong multiplier [edit: it's not actually wrong, just written in a weird way], and then checking that we don't really need these functions anymore, as we only support Python >= 3.7.Checklist
Reviewer Checklist