From a01fd260899afb6e26f43e31d4a8d24cafa4e6c7 Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Sun, 27 Oct 2024 22:24:09 +0300 Subject: [PATCH 1/2] fix(listener,metrics): fix counter of sent proofs --- crates/chain-listener/src/listener.rs | 2 +- crates/peer-metrics/src/chain_listener.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/chain-listener/src/listener.rs b/crates/chain-listener/src/listener.rs index ba9bb650d5..7a8539ded2 100644 --- a/crates/chain-listener/src/listener.rs +++ b/crates/chain-listener/src/listener.rs @@ -1300,8 +1300,8 @@ impl ChainListener { } Ok(tx_id) => { tracing::info!(target: "chain-listener", "Successfully submitted {} proofs, txHash: {tx_id}", unit_ids.len()); + self.observe(|m| m.observe_proof_submitted(unit_ids.len())); self.pending_proof_txs.push((tx_id, unit_ids)); - self.observe(|m| m.observe_proof_submitted()); Ok(()) } diff --git a/crates/peer-metrics/src/chain_listener.rs b/crates/peer-metrics/src/chain_listener.rs index de5240aa7f..c2e5b3d2a0 100644 --- a/crates/peer-metrics/src/chain_listener.rs +++ b/crates/peer-metrics/src/chain_listener.rs @@ -262,8 +262,8 @@ impl ChainListenerMetrics { self.ccp_proofs_submit_failed.inc(); } - pub fn observe_proof_submitted(&self) { - self.ccp_proofs_submitted.inc(); + pub fn observe_proofs_submitted(&self, proofs: u64) { + self.ccp_proofs_submitted.inc_by(proofs); } pub fn observe_proof_tx_success(&self) { From 8c5f1bbfc61759b93d285d9774197b0918ee656b Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Mon, 28 Oct 2024 10:36:10 +0300 Subject: [PATCH 2/2] fix: typo --- crates/chain-listener/src/listener.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/chain-listener/src/listener.rs b/crates/chain-listener/src/listener.rs index 7a8539ded2..08b36db94f 100644 --- a/crates/chain-listener/src/listener.rs +++ b/crates/chain-listener/src/listener.rs @@ -1300,7 +1300,7 @@ impl ChainListener { } Ok(tx_id) => { tracing::info!(target: "chain-listener", "Successfully submitted {} proofs, txHash: {tx_id}", unit_ids.len()); - self.observe(|m| m.observe_proof_submitted(unit_ids.len())); + self.observe(|m| m.observe_proofs_submitted(unit_ids.len() as u64)); self.pending_proof_txs.push((tx_id, unit_ids)); Ok(())