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

Move MinMax type into mz-ore #29222

Merged
merged 1 commit into from
Aug 27, 2024
Merged

Move MinMax type into mz-ore #29222

merged 1 commit into from
Aug 27, 2024

Conversation

teskje
Copy link
Contributor

@teskje teskje commented Aug 26, 2024

This PR moves the MinMax type supporting the compute controller metrics into the mz-ore crate, as it might be generally useful. The type is also renamed to SlidingMinMax to make its purpose more obvious outside the a metrics context.

Motivation

  • This PR refactors existing code.

Tips for reviewer

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@teskje teskje marked this pull request as ready for review August 26, 2024 14:07
@teskje teskje requested review from benesch and a team as code owners August 26, 2024 14:07
/// The push stack and the pop stack, merged into one allocation to optimize memory usage.
///
/// The push stack is the first `push_stack_len` items, the pop stack is the rest.
/// The push stack grows to the left, the pop stack grows to the right.
Copy link
Contributor

@rjobanp rjobanp Aug 26, 2024

Choose a reason for hiding this comment

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

Reading this more carefully, shouldn't this be the push stack grows to the right, pop stack to the left?
In the diagram below the arrows indicate that's what's happening, and it seems that the code does too (top of push stack = push_stack_len)

Copy link
Member

Choose a reason for hiding this comment

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

Ah, good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦 Thanks!

Copy link
Member

@benesch benesch left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

/// The push stack and the pop stack, merged into one allocation to optimize memory usage.
///
/// The push stack is the first `push_stack_len` items, the pop stack is the rest.
/// The push stack grows to the left, the pop stack grows to the right.
Copy link
Member

Choose a reason for hiding this comment

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

Ah, good catch!

This commit moves the `MinMax` type supporting the compute controller
metrics into the mz-ore crate, as it might be generally useful. The type
is also renamed to `SlidingMinMax` to make its purpose more obvious
outside the a metrics context.
@teskje
Copy link
Contributor Author

teskje commented Aug 27, 2024

TFTRs!

@teskje teskje merged commit e194a6f into MaterializeInc:main Aug 27, 2024
81 checks passed
@teskje teskje deleted the ore-minmax branch August 27, 2024 09:13
@github-actions github-actions bot locked and limited conversation to collaborators Aug 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants