Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
leak Metrics type
  • Loading branch information
drahnr committed Jun 23, 2022
commit 28d0ae803eba1d3d18cd7f2877bf067809713999
2 changes: 1 addition & 1 deletion node/network/bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mod network;
use self::network::Network;

mod metrics;
use self::metrics::Metrics;
pub use self::metrics::Metrics;

mod errors;
pub(crate) use self::errors::Error;
Expand Down
1 change: 1 addition & 0 deletions node/network/bridge/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fn peer_set_label(peer_set: PeerSet, version: ProtocolVersion) -> &'static str {
peer_set.get_protocol_name_static(version).unwrap_or("<internal error>")
}

#[allow(missing_docs)]
impl Metrics {
pub fn on_peer_connected(&self, peer_set: PeerSet, version: ProtocolVersion) {
self.0.as_ref().map(|metrics| {
Expand Down
5 changes: 3 additions & 2 deletions node/service/src/overseer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ pub use polkadot_collator_protocol::{CollatorProtocolSubsystem, ProtocolSide};
pub use polkadot_dispute_distribution::DisputeDistributionSubsystem;
pub use polkadot_gossip_support::GossipSupport as GossipSupportSubsystem;
pub use polkadot_network_bridge::{
NetworkBridgeRx as NetworkBridgeRxSubsystem, NetworkBridgeTx as NetworkBridgeTxSubsystem,
Metrics as NetworkBridgeMetrics, NetworkBridgeRx as NetworkBridgeRxSubsystem,
NetworkBridgeTx as NetworkBridgeTxSubsystem,
};
pub use polkadot_node_collation_generation::CollationGenerationSubsystem;
pub use polkadot_node_core_approval_voting::ApprovalVotingSubsystem;
Expand Down Expand Up @@ -191,7 +192,7 @@ where

let spawner = SpawnGlue(spawner);

let network_bridge_metrics = Metrics::register(registry)?;
let network_bridge_metrics: NetworkBridgeMetrics = Metrics::register(registry)?;
let builder = Overseer::builder()
.network_bridge_tx(NetworkBridgeTxSubsystem::new(
network_service.clone(),
Expand Down