Skip to content

Add latency metrics to assembler#992

Open
moradna wants to merge 1 commit into
hyperledger:mainfrom
moradna:assembler-metrics
Open

Add latency metrics to assembler#992
moradna wants to merge 1 commit into
hyperledger:mainfrom
moradna:assembler-metrics

Conversation

@moradna

@moradna moradna commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Signed-off-by: Natalie Morad <natalie.morad@ibm.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the Assembler’s observability by adding histogram-based latency metrics around key batch-processing stages (fetching batches, waiting for batches after attestations, and appending batches to the ledger), and wires those metrics through the Assembler components and documentation.

Changes:

  • Add three new Assembler histogram metrics: batch fetch latency, BA→batch availability latency, and batch ledger append latency.
  • Instrument Prefetcher and Collator to observe the new latency metrics at the relevant points in the processing flow.
  • Update unit tests/benchmarks and the metrics documentation to reflect the new metrics and constructor signatures.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
node/assembler/prefetcher.go Injects Metrics into the Prefetcher and records batch fetch latency observations.
node/assembler/prefetcher_test.go Updates Prefetcher tests to construct and pass Assembler metrics.
node/assembler/prefetch_benchmark/prefetch_benchmark_test.go Updates benchmark setup to construct and pass Assembler metrics.
node/assembler/mocks/prefetcher_factory.go Regenerates/updates the PrefetcherFactory fake to include the new Metrics parameter.
node/assembler/metrics.go Defines new histogram metrics, initializes them, and includes their averages in periodic/stop logging.
node/assembler/collator.go Records BA→batch latency and batch ledger append latency around the corresponding operations.
node/assembler/collator_test.go Updates Collator test construction to include Metrics.
node/assembler/assembler.go Wires Assembler metrics into the PrefetcherFactory and Collator initialization.
node/assembler/assembler_test.go Updates the PrefetcherFactory mock callback signature to include Metrics.
docs/monitoring/metrics.md Documents the three new Assembler latency metrics and fixes a minor formatting inconsistency.
Files not reviewed (1)
  • node/assembler/mocks/prefetcher_factory.go: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants