Aggregate multiprocess replica metrics for console overview view#31850
Merged
SangJunBak merged 1 commit intomainfrom Mar 13, 2025
Merged
Aggregate multiprocess replica metrics for console overview view#31850SangJunBak merged 1 commit intomainfrom
SangJunBak merged 1 commit intomainfrom
Conversation
bcb4c00 to
101dd01
Compare
ParkMyCar
approved these changes
Mar 10, 2025
src/catalog/src/builtin.rs
Outdated
| m.occurred_at, | ||
| m.replica_id, | ||
| r.size, | ||
| (SUM(m.cpu_nano_cores::float8) / (s.cpu_nano_cores * s.processes)) AS cpu_percent, |
Contributor
There was a problem hiding this comment.
It might be nice to pull out the total resource calculation, e.g. s.cpu_nano_cores * s.processes into its own CTE, but up to you!
Contributor
Author
There was a problem hiding this comment.
I may err on not for a few reasons:
- It's nice to have the processes aggregation happen in one CTE. Though we could probably improve the naming to something like
replica_metrics_history_combined_processes - I think it'd actually make the query less readable!
- We'd still need to include the same columns in the groupby
- Stupid reason, but I'd have to change this on the Console side too 😭
Caveat is the groupby calculation doesn't really apply for s.cpu_nano_cores * s.processes. If there were more unrelated MFPs on this query however, I'd probably separate it
a82b9f1 to
f239d48
Compare
We use this query in the Console to power the Environment Overview page and cluster replica graphs for the 14 day time period.
f239d48 to
93f2d01
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We use this query in the Console to power the Environment Overview page and cluster replica graphs for the 14 day time period.
Motivation
Sibling PR to https://github.com/MaterializeInc/console/pull/3733. Query should reflect the duplicate code there
Gabor noticed the utilization graphs being broken for clusters with multiple processes.
https://materializeinc.slack.com/archives/CU7ELJ6E9/p1741596295446089
Tips for reviewer
Checklist
I've tested this manually, but I added a unit test in https://github.com/MaterializeInc/console/pull/3733