Draft
Conversation
Replace all direct uses of counter! with firewood_counter! to ensure metric descriptions are registered consistently. The firewood_counter! macro automatically handles description registration using Once to avoid duplicate registrations while providing better documentation for all metrics. Updated files: - firewood/src/db.rs: proposal counter - firewood/src/merkle/mod.rs: insert/remove counters - storage/src/linear/memory.rs: read counter - storage/src/linear/filebacked.rs: cache and IO counters - ffi/src/handle.rs: FFI batch/commit/cached_view counters - ffi/src/proposal.rs: FFI propose counters - ffi/src/lib.rs: FFI commit counters - ffi/src/proofs/range.rs: FFI merge counters
Previously, the firewood_gauge! macro was incorrectly calling metrics::describe_counter! instead of metrics::describe_gauge!, which would register gauge metrics with incorrect descriptions. This commit: - Fixes the macro to properly call describe_gauge! for both labeled and unlabeled gauge variants - Updates existing gauge usage in manager.rs to use firewood_gauge! macro with proper descriptions - Adds comprehensive tests for both firewood_counter! and firewood_gauge! macros - Updates documentation to include .set() method in gauge usage
- Add firewood.proposals.outstanding gauge in RevisionManager on add/cleanup - Add firewood.proposals.discarded counter during proposal cleanup - Add firewood.proposals.based_on_proposal counter when proposing on a proposal - Add firewood.proposals.reparented counter on commit reparent All metrics use firewood_counter!/firewood_gauge! macros and avoid allocations. Verified with cargo check/nextest across workspace.
…rics - Add firewood.revisions.reaped counter with mode label (with_rootstore|without_rootstore) - Add firewood.revisions.reaping_failed counter on Arc::try_unwrap failure - Add firewood.revisions.historical_queries counter with source label (memory|rootstore) Existing gauges (active/max revisions) kept updated. Verified via cargo check/nextest.
Metrics Change Detection
|
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.
Why this should be merged
How this works
Pretty obvious
How this was tested
Marked DO NOT MERGE until we can properly test it. Depends on getting metrics working.