Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 77d04d4

Browse files
authored
move Metrics to utils (#1765)
1 parent ec55686 commit 77d04d4

File tree

29 files changed

+99
-120
lines changed

29 files changed

+99
-120
lines changed

Cargo.lock

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/collation-generation/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ use polkadot_node_primitives::CollationGenerationConfig;
3030
use polkadot_node_subsystem::{
3131
messages::{AllMessages, CollationGenerationMessage, CollatorProtocolMessage},
3232
FromOverseer, SpawnedSubsystem, Subsystem, SubsystemContext, SubsystemResult,
33-
metrics::{self, prometheus},
3433
};
3534
use polkadot_node_subsystem_util::{
3635
request_availability_cores_ctx, request_full_validation_data_ctx,
3736
request_validators_ctx,
37+
metrics::{self, prometheus},
3838
};
3939
use polkadot_primitives::v1::{
4040
collator_signature_payload, AvailableData, CandidateCommitments,
@@ -164,8 +164,6 @@ impl<Context> Subsystem<Context> for CollationGenerationSubsystem
164164
where
165165
Context: SubsystemContext<Message = CollationGenerationMessage>,
166166
{
167-
type Metrics = Metrics;
168-
169167
fn start(self, ctx: Context) -> SpawnedSubsystem {
170168
let future = Box::pin(self.run(ctx));
171169

node/core/av-store/Cargo.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ authors = ["Parity Technologies <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8+
derive_more = "0.99.9"
89
futures = "0.3.5"
9-
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
10-
polkadot-overseer = { path = "../../overseer" }
11-
polkadot-primitives = { path = "../../../primitives" }
12-
erasure = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" }
10+
log = "0.4.8"
11+
1312
kvdb = "0.7.0"
1413
kvdb-rocksdb = "0.9.1"
1514
codec = { package = "parity-scale-codec", version = "1.3.1", features = ["derive"] }
16-
log = "0.4.8"
17-
derive_more = "0.99.9"
15+
16+
erasure = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" }
17+
polkadot-overseer = { path = "../../overseer" }
18+
polkadot-primitives = { path = "../../../primitives" }
19+
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
20+
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
1821

1922
[dev-dependencies]
2023
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }

node/core/av-store/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ use polkadot_primitives::v1::{
3434
};
3535
use polkadot_subsystem::{
3636
FromOverseer, SubsystemError, Subsystem, SubsystemContext, SpawnedSubsystem,
37+
};
38+
use polkadot_node_subsystem_util::{
3739
metrics::{self, prometheus},
3840
};
3941
use polkadot_subsystem::messages::AvailabilityStoreMessage;
@@ -276,8 +278,6 @@ impl<Context> Subsystem<Context> for AvailabilityStoreSubsystem
276278
where
277279
Context: SubsystemContext<Message=AvailabilityStoreMessage>,
278280
{
279-
type Metrics = Metrics;
280-
281281
fn start(self, ctx: Context) -> SpawnedSubsystem {
282282
let future = Box::pin(async move {
283283
if let Err(e) = run(self, ctx).await {

node/core/backing/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ use polkadot_subsystem::{
4545
ProvisionerMessage, RuntimeApiMessage, StatementDistributionMessage, ValidationFailed,
4646
RuntimeApiRequest,
4747
},
48-
metrics::{self, prometheus},
4948
};
5049
use polkadot_node_subsystem_util::{
5150
self as util,
@@ -55,6 +54,7 @@ use polkadot_node_subsystem_util::{
5554
request_from_runtime,
5655
Validator,
5756
delegated_subsystem,
57+
metrics::{self, prometheus},
5858
};
5959
use statement_table::{
6060
generic::AttestedCandidate as TableAttestedCandidate,

node/core/bitfield-signing/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ use polkadot_node_subsystem::{
2929
BitfieldSigningMessage, CandidateBackingMessage, RuntimeApiMessage,
3030
},
3131
errors::RuntimeApiError,
32-
metrics::{self, prometheus},
3332
};
3433
use polkadot_node_subsystem_util::{
35-
self as util, JobManager, JobTrait, ToJobTrait, Validator
34+
self as util, JobManager, JobTrait, ToJobTrait, Validator,
35+
metrics::{self, prometheus},
3636
};
3737
use polkadot_primitives::v1::{AvailabilityBitfield, CoreState, Hash, ValidatorIndex};
3838
use std::{convert::TryFrom, pin::Pin, time::Duration};

node/core/candidate-selection/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ use polkadot_node_subsystem::{
3030
AllMessages, CandidateBackingMessage, CandidateSelectionMessage,
3131
CandidateValidationMessage, CollatorProtocolMessage,
3232
},
33+
};
34+
use polkadot_node_subsystem_util::{
35+
self as util, delegated_subsystem, JobTrait, ToJobTrait,
3336
metrics::{self, prometheus},
3437
};
35-
use polkadot_node_subsystem_util::{self as util, delegated_subsystem, JobTrait, ToJobTrait};
3638
use polkadot_primitives::v1::{
3739
CandidateDescriptor, CandidateReceipt, CollatorId, Hash, Id as ParaId, PoV,
3840
};

node/core/candidate-validation/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ authors = ["Parity Technologies <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8+
derive_more = "0.99.9"
89
futures = "0.3.5"
10+
log = "0.4.8"
11+
912
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
1013
sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate", branch = "master" }
1114
parity-scale-codec = { version = "1.3.0", default-features = false, features = ["bit-vec", "derive"] }
@@ -14,8 +17,7 @@ polkadot-primitives = { path = "../../../primitives" }
1417
polkadot-parachain = { path = "../../../parachain" }
1518
polkadot-node-primitives = { path = "../../primitives" }
1619
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
17-
derive_more = "0.99.9"
18-
log = "0.4.8"
20+
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
1921

2022
[dev-dependencies]
2123
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }

node/core/candidate-validation/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ use polkadot_subsystem::{
2727
AllMessages, CandidateValidationMessage, RuntimeApiMessage,
2828
ValidationFailed, RuntimeApiRequest,
2929
},
30+
};
31+
use polkadot_node_subsystem_util::{
3032
metrics::{self, prometheus},
3133
};
3234
use polkadot_subsystem::errors::RuntimeApiError;
@@ -113,8 +115,6 @@ impl<S, C> Subsystem<C> for CandidateValidationSubsystem<S> where
113115
C: SubsystemContext<Message = CandidateValidationMessage>,
114116
S: SpawnNamed + Clone + 'static,
115117
{
116-
type Metrics = Metrics;
117-
118118
fn start(self, ctx: C) -> SpawnedSubsystem {
119119
SpawnedSubsystem {
120120
name: "candidate-validation-subsystem",

node/core/chain-api/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ futures = { version = "0.3.5" }
99
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
1010
polkadot-primitives = { path = "../../../primitives" }
1111
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
12+
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
1213

1314
[dev-dependencies]
1415
futures = { version = "0.3.5", features = ["thread-pool"] }

0 commit comments

Comments
 (0)