Skip to content

Conversation

@KatyaRyazantseva
Copy link
Collaborator

This PR adds Devnet-0 metrics.

  • Added Counter metric type with and without labels.
  • Added Histogram metric type with and without labels, with configurable buckets.
  • Implemented HistogramTimer helper for automatic timing measurements
  • Integrated Devnet-0 metrics.

@kamilsa kamilsa requested review from Copilot and turuslan October 28, 2025 06:34
Copy link
Contributor

Copilot AI left a 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.

@kamilsa kamilsa merged commit 7d3388e into qdrvm:master Oct 31, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants