-
Notifications
You must be signed in to change notification settings - Fork 3
Add devnet-0 metrics #30
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
Conversation
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 PR adds comprehensive metrics support for Devnet-0, introducing Counter and Histogram metric types alongside the existing Gauge metrics. The changes enable performance monitoring and operational visibility across state transitions, attestation processing, and validator management.
Key changes:
- Implemented Counter and Histogram metric types with optional label support and configurable buckets
- Added HistogramTimer helper class for automatic timing measurements with RAII pattern
- Integrated metrics throughout blockchain components (STF, fork choice, validator registry)
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/metrics/metrics.hpp | Added Counter/Histogram interfaces and HistogramTimer helper class |
| src/metrics/impl/metrics_impl.hpp | Extended MetricsImpl with Counter and Histogram method declarations |
| src/metrics/impl/metrics_impl.cpp | Implemented Counter and Histogram metric registration and accessors |
| src/blockchain/state_transition_function.hpp | Added metrics dependency to STF class |
| src/blockchain/state_transition_function.cpp | Integrated timing and counting metrics for state transitions, slots, blocks, and attestations |
| src/blockchain/impl/validator_registry_impl.hpp | Added metrics parameter to ValidatorRegistryImpl constructors |
| src/blockchain/impl/validator_registry_impl.cpp | Implemented validator count metric |
| src/blockchain/fork_choice.cpp | Added attestation validation and block processing metrics |
| src/blockchain/state_transition_metrics.def | Defined STF-related metrics (justification, finalization, timing counters) |
| src/blockchain/impl/validator_metrics.def | Defined validator count gauge metric |
| src/blockchain/fork_choice_metrics.def | Updated with attestation validation and block processing metrics |
| src/app/application_metrics.def | Updated documentation format for consistency |
| src/metrics/all_metrics.def | Added includes for new metric definition files |
| tests/mock/blockchain/metrics_mock.hpp | Extended mock with Counter and Histogram implementations |
| tests/unit/blockchain/state_transition_function_test.cpp | Updated test to pass metrics mock to STF |
| tests/unit/utils/validator_registry_test.cpp | Updated tests to pass metrics mock to ValidatorRegistryImpl |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR adds Devnet-0 metrics.
Countermetric type with and without labels.Histogrammetric type with and without labels, with configurable buckets.HistogramTimerhelper for automatic timing measurements