-
Notifications
You must be signed in to change notification settings - Fork 425
refactor: convert to prometheus values directly from arrow #7153
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
refactor: convert to prometheus values directly from arrow #7153
Conversation
Signed-off-by: luofucong <[email protected]>
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.
Pull Request Overview
This pull request introduces a new Column type (a wrapper around Arc<String>) to optimize memory usage in Prometheus HTTP API responses by avoiding unnecessary string cloning when column names are used as HashMap keys.
Key changes:
- Introduced the
Columntype to hold Arc references to column names - Refactored
record_batches_to_seriesto use a newRowWriterstruct for comprehensive data type handling - Updated test cases to use the new
Columntype
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/servers/src/http/prometheus.rs | Introduces Column type, adds RowWriter for row-by-row conversion with comprehensive data type support, implements trait-based column reference pattern for efficient HashMap lookups |
| tests-integration/tests/http.rs | Updates test to import and use the new Column type in series assertions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: luofucong <[email protected]>
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your intention?
following #7131
for prometheus values (http output)
also reduced some memory for storing intermediate prometheus series data
PR Checklist
Please convert it to a draft if some of the following conditions are not met.