cargo +nightly fmt (#3540)

* cargo +nightly fmt

* add cargo-fmt check to ci

* update ci

* fmt

* fmt

* skip macro

* ignore bridges
This commit is contained in:
Shawn Tabrizi
2021-08-02 12:47:33 +02:00
committed by GitHub
parent 30e3012270
commit ff5d56fb76
350 changed files with 20617 additions and 21266 deletions
+38 -39
View File
@@ -33,7 +33,6 @@ struct MetricsInner {
signals_received: prometheus::GaugeVec<prometheus::U64>,
}
/// A shareable metrics type for usage with the overseer.
#[derive(Default, Clone)]
pub struct Metrics(Option<MetricsInner>);
@@ -59,30 +58,42 @@ impl Metrics {
pub(crate) fn channel_fill_level_snapshot(
&self,
collection: impl IntoIterator<Item=(&'static str, SubsystemMeterReadouts)>,
collection: impl IntoIterator<Item = (&'static str, SubsystemMeterReadouts)>,
) {
if let Some(metrics) = &self.0 {
collection.into_iter().for_each(
|(name, readouts): (_, SubsystemMeterReadouts)| {
metrics.to_subsystem_bounded_sent.with_label_values(&[name])
.set(readouts.bounded.sent as u64);
collection
.into_iter()
.for_each(|(name, readouts): (_, SubsystemMeterReadouts)| {
metrics
.to_subsystem_bounded_sent
.with_label_values(&[name])
.set(readouts.bounded.sent as u64);
metrics.to_subsystem_bounded_received.with_label_values(&[name])
.set(readouts.bounded.received as u64);
metrics
.to_subsystem_bounded_received
.with_label_values(&[name])
.set(readouts.bounded.received as u64);
metrics.to_subsystem_unbounded_sent.with_label_values(&[name])
.set(readouts.unbounded.sent as u64);
metrics
.to_subsystem_unbounded_sent
.with_label_values(&[name])
.set(readouts.unbounded.sent as u64);
metrics.to_subsystem_unbounded_received.with_label_values(&[name])
.set(readouts.unbounded.received as u64);
metrics
.to_subsystem_unbounded_received
.with_label_values(&[name])
.set(readouts.unbounded.received as u64);
metrics.signals_sent.with_label_values(&[name])
.set(readouts.signals.sent as u64);
metrics
.signals_sent
.with_label_values(&[name])
.set(readouts.signals.sent as u64);
metrics.signals_received.with_label_values(&[name])
.set(readouts.signals.received as u64);
}
);
metrics
.signals_received
.with_label_values(&[name])
.set(readouts.signals.received as u64);
});
}
}
}
@@ -93,21 +104,21 @@ impl metrics::Metrics for Metrics {
activated_heads_total: prometheus::register(
prometheus::Counter::new(
"parachain_activated_heads_total",
"Number of activated heads."
"Number of activated heads.",
)?,
registry,
)?,
deactivated_heads_total: prometheus::register(
prometheus::Counter::new(
"parachain_deactivated_heads_total",
"Number of deactivated heads."
"Number of deactivated heads.",
)?,
registry,
)?,
messages_relayed_total: prometheus::register(
prometheus::Counter::new(
"parachain_messages_relayed_total",
"Number of messages relayed by Overseer."
"Number of messages relayed by Overseer.",
)?,
registry,
)?,
@@ -117,9 +128,7 @@ impl metrics::Metrics for Metrics {
"parachain_subsystem_bounded_sent",
"Number of elements sent to subsystems' bounded queues",
),
&[
"subsystem_name",
],
&["subsystem_name"],
)?,
registry,
)?,
@@ -129,9 +138,7 @@ impl metrics::Metrics for Metrics {
"parachain_subsystem_bounded_received",
"Number of elements received by subsystems' bounded queues",
),
&[
"subsystem_name",
],
&["subsystem_name"],
)?,
registry,
)?,
@@ -141,9 +148,7 @@ impl metrics::Metrics for Metrics {
"parachain_subsystem_unbounded_sent",
"Number of elements sent to subsystems' unbounded queues",
),
&[
"subsystem_name",
],
&["subsystem_name"],
)?,
registry,
)?,
@@ -153,9 +158,7 @@ impl metrics::Metrics for Metrics {
"parachain_subsystem_unbounded_received",
"Number of elements received by subsystems' unbounded queues",
),
&[
"subsystem_name",
],
&["subsystem_name"],
)?,
registry,
)?,
@@ -165,9 +168,7 @@ impl metrics::Metrics for Metrics {
"parachain_overseer_signals_sent",
"Number of signals sent by overseer to subsystems",
),
&[
"subsystem_name",
],
&["subsystem_name"],
)?,
registry,
)?,
@@ -177,9 +178,7 @@ impl metrics::Metrics for Metrics {
"parachain_overseer_signals_received",
"Number of signals received by subsystems from overseer",
),
&[
"subsystem_name",
],
&["subsystem_name"],
)?,
registry,
)?,