{{ message }}
feat: add executor future helpers and metrics utilities - #47
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a C++ metrics implementation (counters/gauges/windowed histograms) with JSON serialization, plus a small async Via() helper and associated unit tests.
Changes:
- Introduce
MetricsImplwith counter/gauge/histogram support, merge/overwrite, andToString()JSON output. - Add
HistogramImplandHistogramWindowingImpl(windowed aggregation) with cloning/merging behavior. - Add new unit tests for metrics, histograms, executors, IO hook, and factory creator.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+87
to
+88
| double min_ = std::numeric_limits<double>::infinity(); | ||
| double max_ = 0; |
Comment on lines
+193
to
+194
| double upper = (i < limits.size()) ? limits[i] : s.max; | ||
| double lower = (i == 0) ? std::min(s.min, 0.0) : limits[i - 1]; |
Comment on lines
+50
to
+53
| void TearDown() override { | ||
| factory_creator_->~FactoryCreator(); | ||
| new (factory_creator_) FactoryCreator(); | ||
| } |
Comment on lines
+26
to
+30
| uint64_t HistogramWindowingImpl::NowMicros() { | ||
| return std::chrono::duration_cast<std::chrono::microseconds>( | ||
| std::chrono::system_clock::now().time_since_epoch()) | ||
| .count(); | ||
| } |
Comment on lines
+216
to
+217
| doc.AddMember(rapidjson::Value(kv.first, allocator), rapidjson::Value(kv.second), | ||
| allocator); |
Comment on lines
+224
to
+225
| doc.AddMember(rapidjson::Value(name + ".count", allocator), rapidjson::Value(s.count), | ||
| allocator); |
leaves12138
approved these changes
Jun 4, 2026
leaves12138
left a comment
Contributor
There was a problem hiding this comment.
Re-reviewed PR #47 after the public metrics interface was added. I did not find any remaining blockers. Approved.
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.

Purpose
Linked issue: No linked issue
This change adds shared runtime utility implementations and test coverage under
src/paimon/common.Included changes:
src/paimon/common/executor/future.hfor submitting callables through anExecutorand returningstd::futureresults.voidfutures.DefaultExecutorTestcoverage for async submission, result collection, exception propagation, immediate shutdown, and ignored submissions after shutdown.FactoryCreatorTestcoverage for factory creator registration and lookup behavior.IOHookTestcoverage for IO hook registration behavior.include/paimon/metrics.h.Tests
Not run. Local compile, CMake, and gtest environment checks are not part of this PR description.
Test coverage included in this change:
DefaultExecutorTestFactoryCreatorTestIOHookTestHistogramTestHistogramWindowingTestMetricsImplTestAPI and Format
This change adds the public metrics API in
include/paimon/metrics.h.No storage format or protocol changes.
Documentation
No documentation changes required.
Generative AI tooling
Generated-by: Aone Copilot