Skip to content

Commit

Permalink
collapse the "check mempool feature" checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorycoppola committed Feb 1, 2022
1 parent 4be27a3 commit b88d8ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
10 changes: 4 additions & 6 deletions src/chainstate/stacks/db/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5009,12 +5009,10 @@ impl StacksChainState {
None,
)?;

let block_limit = clarity_tx
.block_limit()
.unwrap_or_else(|| {
warn!("Failed to read transaction block limit");
ExecutionCost::max_value()
});
let block_limit = clarity_tx.block_limit().unwrap_or_else(|| {
warn!("Failed to read transaction block limit");
ExecutionCost::max_value()
});

let (
scheduled_miner_reward,
Expand Down
25 changes: 12 additions & 13 deletions src/monitoring/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,18 @@ pub fn set_last_execution_cost_observed(
block_limit: &ExecutionCost,
) {
#[cfg(feature = "monitoring_prom")]
prometheus::LAST_BLOCK_READ_COUNT
.set(execution_cost.read_count as f64 / block_limit.read_count as f64);
#[cfg(feature = "monitoring_prom")]
prometheus::LAST_BLOCK_WRITE_COUNT
.set(execution_cost.write_count as f64 / block_limit.read_count as f64);
#[cfg(feature = "monitoring_prom")]
prometheus::LAST_BLOCK_READ_LENGTH
.set(execution_cost.read_length as f64 / block_limit.read_length as f64);
#[cfg(feature = "monitoring_prom")]
prometheus::LAST_BLOCK_WRITE_LENGTH
.set(execution_cost.write_length as f64 / block_limit.write_length as f64);
#[cfg(feature = "monitoring_prom")]
prometheus::LAST_BLOCK_RUNTIME.set(execution_cost.runtime as f64 / block_limit.runtime as f64);
{
prometheus::LAST_BLOCK_READ_COUNT
.set(execution_cost.read_count as f64 / block_limit.read_count as f64);
prometheus::LAST_BLOCK_WRITE_COUNT
.set(execution_cost.write_count as f64 / block_limit.read_count as f64);
prometheus::LAST_BLOCK_READ_LENGTH
.set(execution_cost.read_length as f64 / block_limit.read_length as f64);
prometheus::LAST_BLOCK_WRITE_LENGTH
.set(execution_cost.write_length as f64 / block_limit.write_length as f64);
prometheus::LAST_BLOCK_RUNTIME
.set(execution_cost.runtime as f64 / block_limit.runtime as f64);
}
}

pub fn increment_btc_ops_sent_counter() {
Expand Down

0 comments on commit b88d8ce

Please sign in to comment.