Skip to content

Conversation

beniwohli
Copy link
Contributor

@beniwohli beniwohli commented Mar 15, 2022

timedelta only allows comparisons, additions and substractions
with other objects of type timedelta, not with unit-less floats or ints.

This should ensure that we only ever compare durations of the same
unit, not e.g. milliseconds to seconds.

The Seconds type only allows comparisons, additions and substractions with other objects of type Seconds, not with unit-less floats or ints. This should ensure that we only ever compare durations of the same type, not e.g. milliseconds to seconds.
@ghost
Copy link

ghost commented Mar 15, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-03-29T16:31:13.278+0000

  • Duration: 21 min 12 sec

Test stats 🧪

Test Results
Failed 0
Passed 4768
Skipped 3209
Total 7977

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /test linters : Run the Python linters only.

  • /test full : Run the full matrix of tests.

  • /test benchmark : Run the APM Agent Python benchmarks tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far. I'll do an in-depth review for accuracy once tests are passing. But overall I think it's a good direction. We definitely need to standardize so this doesn't bite us again.

@beniwohli
Copy link
Contributor Author

/test full

also, introduce a _DurationConfigValue that handles everything
@beniwohli beniwohli changed the title use an explicit Seconds type for any durations use timedelta for any durations Mar 21, 2022
@beniwohli
Copy link
Contributor Author

/test full

Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid! Let me know if I can help with the integration test failures.

it's impossible to know which unit the sum value in Prometheus summaries has, so we can't properly convert it to a timedelta.
@basepi
Copy link
Contributor

basepi commented Mar 24, 2022

/test full

@beniwohli beniwohli marked this pull request as ready for review March 28, 2022 07:15
@beniwohli beniwohli requested a review from basepi March 29, 2022 11:32
Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So much goodness here. Quite a few places where I noted "oh, that's much clearer" while reviewing. 👍

@basepi basepi merged commit 8ad296a into elastic:main Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants