Skip to content

Commit

Permalink
Add ckb_freezer_number to ckb_metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Nov 21, 2024
1 parent fdc3a50 commit b529191
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shared/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ impl Shared {
frozen_number,
threshold
);
if let Some(metrics) = ckb_metrics::handle() {
metrics.ckb_freezer_number.set(frozen_number);
}

let store = self.store();
let get_unfrozen_block = |number: BlockNumber| {
Expand Down
3 changes: 3 additions & 0 deletions util/metrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ pub struct Metrics {
pub ckb_freezer_size: IntGauge,
/// Counter for measuring the effective amount of data read
pub ckb_freezer_read: IntCounter,
/// Gauge for tracking the number of ckb_freezer
pub ckb_freezer_number: IntGauge,
/// Counter for relay transaction short id collide
pub ckb_relay_transaction_short_id_collide: IntCounter,
/// Histogram for relay compact block verify duration
Expand Down Expand Up @@ -209,6 +211,7 @@ static METRICS: std::sync::LazyLock<Metrics> = std::sync::LazyLock::new(|| {
),
ckb_freezer_size: register_int_gauge!("ckb_freezer_size", "The CKB freezer size").unwrap(),
ckb_freezer_read: register_int_counter!("ckb_freezer_read", "The CKB freezer read").unwrap(),
ckb_freezer_number: register_int_gauge!("ckb_freezer_number", "The CKB freezer number").unwrap(),
ckb_relay_transaction_short_id_collide: register_int_counter!(
"ckb_relay_transaction_short_id_collide",
"The CKB relay transaction short id collide"
Expand Down

0 comments on commit b529191

Please sign in to comment.