diff --git a/committer/src/setup.rs b/committer/src/setup.rs index 5fc51df1..db03fcde 100644 --- a/committer/src/setup.rs +++ b/committer/src/setup.rs @@ -330,7 +330,7 @@ pub fn fee_metrics_tracker( config: &config::Config, registry: &Registry, ) -> Result> { - let fee_metrics_tracker = FeeMetricsTracker::new(api, config.fee_algo_config().sma_periods); + let fee_metrics_tracker = FeeMetricsTracker::new(api); fee_metrics_tracker.register_metrics(registry); diff --git a/packages/services/src/fee_metrics_tracker.rs b/packages/services/src/fee_metrics_tracker.rs index 200e1bcb..831be648 100644 --- a/packages/services/src/fee_metrics_tracker.rs +++ b/packages/services/src/fee_metrics_tracker.rs @@ -8,15 +8,12 @@ pub mod service { use crate::{ fees::{Api, Fees}, - state_committer::SmaPeriods, Result, Runner, }; #[derive(Debug, Clone)] struct FeeMetrics { current: IntGauge, - short: IntGauge, - long: IntGauge, } impl Default for FeeMetrics { @@ -27,40 +24,19 @@ pub mod service { )) .expect("metric config to be correct"); - let short = IntGauge::with_opts(Opts::new( - "short_term_blob_tx_fee", - "The short term fee for a transaction with 6 blobs", - )) - .expect("metric config to be correct"); - - let long = IntGauge::with_opts(Opts::new( - "long_term_blob_tx_fee", - "The long term fee for a transaction with 6 blobs", - )) - .expect("metric config to be correct"); - - Self { - current, - short, - long, - } + Self { current } } } impl

RegistersMetrics for FeeMetricsTracker

{ fn metrics(&self) -> Vec> { - vec![ - Box::new(self.metrics.current.clone()), - Box::new(self.metrics.short.clone()), - Box::new(self.metrics.long.clone()), - ] + vec![Box::new(self.metrics.current.clone())] } } #[derive(Clone)] pub struct FeeMetricsTracker

{ fee_provider: P, - sma_periods: SmaPeriods, metrics: FeeMetrics, } @@ -83,10 +59,9 @@ pub mod service { } impl

FeeMetricsTracker

{ - pub fn new(fee_provider: P, sma_periods: SmaPeriods) -> Self { + pub fn new(fee_provider: P) -> Self { Self { fee_provider, - sma_periods, metrics: FeeMetrics::default(), } } @@ -106,12 +81,8 @@ pub mod service { }; let current = tx_fees_for_last_n_blocks(1.try_into().expect("not zero")).await?; - let short_term = tx_fees_for_last_n_blocks(self.sma_periods.short).await?; - let long_term = tx_fees_for_last_n_blocks(self.sma_periods.long).await?; self.metrics.current.set(current); - self.metrics.short.set(short_term); - self.metrics.long.set(long_term); Ok(()) }