Skip to content

Commit 7559ed1

Browse files
authored
chore(l1): renaming to remove metrics_ prefix from file names (#5385)
**Motivation** This was needed before when we didn't had a `/metrics` folder, now the prefix is unnecessary **Description** remove unnecessary `metrics_` prefix from metric modules Closes #5378
1 parent 926247b commit 7559ed1

File tree

12 files changed

+15
-16
lines changed

12 files changed

+15
-16
lines changed

cmd/ethrex/initializers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub fn open_store(datadir: &Path) -> Store {
121121
#[cfg(feature = "rocksdb")]
122122
let engine_type = EngineType::RocksDB;
123123
#[cfg(feature = "metrics")]
124-
ethrex_metrics::metrics_process::set_datadir_path(datadir.to_path_buf());
124+
ethrex_metrics::process::set_datadir_path(datadir.to_path_buf());
125125
Store::new(datadir, engine_type).expect("Failed to create Store")
126126
}
127127
}

crates/blockchain/blockchain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use tokio_util::sync::CancellationToken;
5252
use vm::StoreVmDatabase;
5353

5454
#[cfg(feature = "metrics")]
55-
use ethrex_metrics::metrics_blocks::METRICS_BLOCKS;
55+
use ethrex_metrics::blocks::METRICS_BLOCKS;
5656

5757
#[cfg(feature = "c-kzg")]
5858
use ethrex_common::types::BlobsBundle;

crates/blockchain/fork_choice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub async fn apply_fork_choice(
110110
.await?;
111111

112112
metrics!(
113-
use ethrex_metrics::metrics_blocks::METRICS_BLOCKS;
113+
use ethrex_metrics::blocks::METRICS_BLOCKS;
114114

115115
METRICS_BLOCKS.set_head_height(head.number);
116116
);

crates/blockchain/metrics/api.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ use axum::{Router, routing::get};
33
use crate::profiling::gather_profiling_metrics;
44

55
use crate::{
6-
MetricsApiError, metrics_blocks::METRICS_BLOCKS, metrics_process::METRICS_PROCESS,
7-
metrics_transactions::METRICS_TX,
6+
MetricsApiError, blocks::METRICS_BLOCKS, process::METRICS_PROCESS, transactions::METRICS_TX,
87
};
98

109
pub async fn start_prometheus_metrics_api(
File renamed without changes.

crates/blockchain/metrics/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#[cfg(feature = "api")]
22
pub mod api;
3+
#[cfg(any(feature = "api", feature = "metrics"))]
4+
pub mod blocks;
35
#[cfg(feature = "api")]
46
pub mod l2;
57
#[cfg(any(feature = "api", feature = "metrics"))]
6-
pub mod metrics_blocks;
7-
#[cfg(any(feature = "api", feature = "metrics"))]
8-
pub mod metrics_process;
9-
#[cfg(any(feature = "api", feature = "transactions"))]
10-
pub mod metrics_transactions;
8+
pub mod process;
119
#[cfg(feature = "api")]
1210
pub mod profiling;
11+
#[cfg(any(feature = "api", feature = "transactions"))]
12+
pub mod transactions;
1313

1414
/// A macro to conditionally enable metrics-related code.
1515
///

crates/blockchain/payload.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ use ethrex_storage::{Store, error::StoreError};
2727
use ethrex_metrics::metrics;
2828

2929
#[cfg(feature = "metrics")]
30-
use ethrex_metrics::metrics_blocks::METRICS_BLOCKS;
30+
use ethrex_metrics::blocks::METRICS_BLOCKS;
3131
#[cfg(feature = "metrics")]
32-
use ethrex_metrics::metrics_transactions::{METRICS_TX, MetricsTxType};
32+
use ethrex_metrics::transactions::{METRICS_TX, MetricsTxType};
3333
use tokio_util::sync::CancellationToken;
3434

3535
use crate::{

crates/l2/sequencer/block_producer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use super::errors::BlockProducerError;
3333

3434
use ethrex_metrics::metrics;
3535
#[cfg(feature = "metrics")]
36-
use ethrex_metrics::{metrics_blocks::METRICS_BLOCKS, metrics_transactions::METRICS_TX};
36+
use ethrex_metrics::{blocks::METRICS_BLOCKS, transactions::METRICS_TX};
3737

3838
#[derive(Clone)]
3939
pub enum CallMessage {

0 commit comments

Comments
 (0)