Skip to content

Commit

Permalink
added set_miner_current_rejections_timeout and set_miner_current_reje…
Browse files Browse the repository at this point in the history
…ctions to Counters struct
  • Loading branch information
rdeioris committed Jan 31, 2025
1 parent fe429f4 commit 6a238a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 2 additions & 5 deletions testnet/stacks-node/src/nakamoto_node/signer_coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,8 @@ impl SignerCoordinator {
"rejections_step" => rejections_step,
"rejections_threshold" => self.total_weight.saturating_sub(self.weight_threshold));

Counters::set(
&counters.naka_miner_current_rejections_timeout_secs,
rejections_timeout.as_secs(),
);
Counters::set(&counters.naka_miner_current_rejections, rejections);
counters.set_miner_current_rejections_timeout(rejections_timeout.as_secs());
counters.set_miner_current_rejections(rejections);
}

if block_status
Expand Down
12 changes: 10 additions & 2 deletions testnet/stacks-node/src/run_loop/neon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ impl Counters {
fn inc(_ctr: &RunLoopCounter) {}

#[cfg(test)]
pub fn set(ctr: &RunLoopCounter, value: u64) {
fn set(ctr: &RunLoopCounter, value: u64) {
ctr.0.store(value, Ordering::SeqCst);
}

#[cfg(not(test))]
pub fn set(_ctr: &RunLoopCounter, _value: u64) {}
fn set(_ctr: &RunLoopCounter, _value: u64) {}

pub fn bump_blocks_processed(&self) {
Counters::inc(&self.blocks_processed);
Expand Down Expand Up @@ -217,6 +217,14 @@ impl Counters {
pub fn set_microblocks_processed(&self, value: u64) {
Counters::set(&self.microblocks_processed, value)
}

pub fn set_miner_current_rejections_timeout(&self, value: u64) {
Counters::set(&self.naka_miner_current_rejections_timeout_secs, value)
}

pub fn set_miner_current_rejections(&self, value: u64) {
Counters::set(&self.naka_miner_current_rejections, value)
}
}

/// Coordinating a node running in neon mode.
Expand Down

0 comments on commit 6a238a7

Please sign in to comment.