Skip to content

Commit be6a76c

Browse files
committed
Fees metric reset by block
1 parent a5b09f6 commit be6a76c

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ clap-verbosity-flag = "2.1.1"
1212
namada_sdk = { version = "0.47.1", default-features = false, features = ["std", "async-send", "download-params"] }
1313
tendermint-config = "0.40.1"
1414
tendermint-rpc = { version = "0.40.1", features = ["http-client"] }
15-
1615
tokio = {version = "1.8.2", default-features = false}
1716
async-trait = "0.1.74"
1817
reqwest = { version = "0.11.22", features = ["json"] }
@@ -32,4 +31,3 @@ tokio-retry2 = { version = "0.5", features = ["jitter", "tracing"] }
3231

3332
[build-dependencies]
3433
vergen = { version = "8.0.0", features = ["build", "git", "gitcl"] }
35-

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct AppConfig {
2323
#[clap(long, env, default_value_t = u64::MAX)]
2424
pub last_block_height: u64,
2525

26-
#[clap(long, env, default_value_t = 500)]
26+
#[clap(long, env, default_value_t = 1000)]
2727
pub sleep_for: u64,
2828

2929
#[clap(flatten)]

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ async fn main() -> anyhow::Result<()> {
157157
}
158158

159159
fn retry_strategy(max_delay_milis: u64) -> ExponentialBackoff {
160-
ExponentialBackoff::from_millis(100)
160+
ExponentialBackoff::from_millis(1000)
161161
.factor(1)
162162
.max_delay_millis(max_delay_milis)
163163
}

src/metrics/fees.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ impl MetricTrait for Fees {
3232

3333
fn reset(&self, state: &State) {
3434
let block = state.get_last_block();
35+
self.fees.reset();
3536
for tx in &block.transactions {
3637
let amount_per_gas = tx.fee.amount_per_gas_unit.parse::<f64>();
3738
let gas_limit = tx.fee.gas.parse::<f64>();

src/metrics/transfers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// ## Transfer Amount (transfer_amount)
2-
/// This metric tracks the total amount of tokens transferred per epoch. It helps monitor token movement trends and detect unusual
3-
/// transfer activity.
2+
/// This metric tracks the total amount of tokens transferred since the monitoring started.
3+
/// It helps monitor token movement trends and detect unusual transfer activity.
44
///
55
/// ### Example
66
/// ```

src/rpc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ impl Rpc {
168168
.collect();
169169

170170
let events_res = self.concurrent_requests(events_futures).await;
171+
171172
let events = events_res.map(BlockResult::from).context(format!(
172173
"Should be able to query for block events for height: {}",
173174
block_height
@@ -387,8 +388,8 @@ impl Rpc {
387388
let (result, index, remaining) = futures::future::select_all(futures).await;
388389
match result {
389390
Ok(value) => return Some((index, value)),
390-
Err(_e) => {
391-
//tracing::error!("Error: {:?}", _e);
391+
Err(e) => {
392+
tracing::error!("Error: {:?}", e);
392393
futures = remaining
393394
}
394395
}

0 commit comments

Comments
 (0)