chore(metrics): restructure crates (#2850)

This commit is contained in:
Roman Krasiuk
2023-05-26 15:21:48 +03:00
committed by GitHub
parent 966b31c191
commit 10b577096b
34 changed files with 110 additions and 119 deletions

View File

@ -13,7 +13,7 @@ reth-interfaces = { path = "../../interfaces" }
reth-primitives = { path = "../../primitives" }
reth-db = { path = "../../storage/db" }
reth-tasks = { path = "../../tasks" }
reth-metrics-derive = { path = "../../metrics/metrics-derive" }
reth-metrics = { path = "../../metrics" }
# async
futures = "0.3"
@ -25,7 +25,6 @@ tokio-util = { version = "0.7", features = ["codec"] }
# misc
tracing = { workspace = true }
metrics = "0.20.1"
rayon = "1.6.0"
# optional deps for the test-utils feature

View File

@ -1,6 +1,8 @@
use metrics::{Counter, Gauge};
use reth_interfaces::p2p::error::DownloadError;
use reth_metrics_derive::Metrics;
use reth_metrics::{
metrics::{self, Counter, Gauge},
Metrics,
};
/// Common downloader metrics.
///

View File

@ -17,6 +17,7 @@ reth-codecs = { path = "../../storage/codecs" }
reth-primitives = { path = "../../primitives" }
reth-ecies = { path = "../ecies" }
reth-rlp = { path = "../../rlp", features = ["alloc", "derive", "std", "ethereum-types", "smol_str"] }
reth-metrics = { path = "../../metrics" }
# used for Chain and builders
ethers-core = { version = "2.0.4", default-features = false}
@ -29,7 +30,6 @@ pin-project = "1.0"
tracing = { workspace = true }
snap = "1.0.5"
smol_str = "0.1"
metrics = "0.20.1"
async-trait = "0.1"
# arbitrary utils

View File

@ -7,9 +7,9 @@ use crate::{
DisconnectReason, HelloMessage,
};
use futures::{Sink, SinkExt, StreamExt};
use metrics::counter;
use pin_project::pin_project;
use reth_codecs::derive_arbitrary;
use reth_metrics::metrics::{self, counter};
use reth_primitives::{
bytes::{Buf, BufMut, Bytes, BytesMut},
hex,

View File

@ -30,7 +30,7 @@ reth-rlp-derive = { path = "../../rlp/rlp-derive" }
reth-tasks = { path = "../../tasks" }
reth-transaction-pool = { path = "../../transaction-pool" }
reth-provider = { path = "../../storage/provider"}
reth-metrics-common = { path = "../../metrics/common" }
reth-metrics = { path = "../../metrics", features = ["common"] }
reth-rpc-types = { path = "../../rpc/rpc-types" }
# async/futures
@ -45,10 +45,6 @@ serde = { version = "1.0", optional = true }
humantime-serde = { version = "1.1", optional = true }
serde_json = { version = "1.0", optional = true }
# metrics
metrics = "0.20.1"
reth-metrics-derive = { path = "../../metrics/metrics-derive" }
# misc
auto_impl = "1"
aquamarine = "0.3.0"

View File

@ -1,6 +1,8 @@
use metrics::{Counter, Gauge};
use reth_eth_wire::DisconnectReason;
use reth_metrics_derive::Metrics;
use reth_metrics::{
metrics::{self, Counter, Gauge},
Metrics,
};
/// Metrics for the entire network, handled by NetworkManager
#[derive(Metrics)]

View File

@ -19,7 +19,7 @@ use reth_eth_wire::{
DisconnectReason, EthMessage, EthStream, P2PStream,
};
use reth_interfaces::p2p::error::RequestError;
use reth_metrics_common::metered_sender::MeteredSender;
use reth_metrics::common::metered_sender::MeteredSender;
use reth_net_common::bandwidth_meter::MeteredStream;
use reth_primitives::PeerId;
use std::{

View File

@ -19,7 +19,7 @@ use reth_eth_wire::{
errors::EthStreamError,
DisconnectReason, EthVersion, HelloMessage, Status, UnauthedEthStream, UnauthedP2PStream,
};
use reth_metrics_common::metered_sender::MeteredSender;
use reth_metrics::common::metered_sender::MeteredSender;
use reth_net_common::{
bandwidth_meter::{BandwidthMeter, MeteredStream},
stream::HasRemoteAddr,