Skip to content

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Oct 7, 2024

What this PR does

This PR modifies the behaviour of rate and increase to only reduce the resolution of the computed delta once, rather than every time the schema reduces in the input range.

This has no noticeable performance impact in our benchmarks as we don't exercise this case, as it rarely happens in practice.

Which issue(s) this PR fixes or relates to

Follow up to #9518 (comment)

Checklist

  • [n/a] Tests updated.
  • [n/a] Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • [n/a] about-versioning.md updated with experimental features.

@charleskorn charleskorn marked this pull request as ready for review October 7, 2024 01:54
@charleskorn charleskorn requested a review from a team as a code owner October 7, 2024 01:54
Copy link
Contributor

@jhesketh jhesketh left a comment

Choose a reason for hiding this comment

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

Thanks for following this up!

if p.H.Schema < delta.Schema {
delta = delta.CopyToSchema(p.H.Schema)
if p.H.Schema < desiredSchema {
desiredSchema = p.H.Schema
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to copy delta to the desired schema at each counter reset (ie before adding the previous value)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No - Add handles the case where the histograms have different schemas and will return a histogram with the lower of the two schemas (ie. the lower resolution).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, forgot about that.

@charleskorn charleskorn enabled auto-merge (squash) October 8, 2024 00:29
@charleskorn charleskorn merged commit c4cd8d1 into main Oct 8, 2024
29 checks passed
@charleskorn charleskorn deleted the charleskorn/mqe-rate-increase branch October 8, 2024 00:56
@jhesketh jhesketh mentioned this pull request Dec 2, 2024
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

Successfully merging this pull request may close these issues.

2 participants