mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
Simplify a few chain components creation APIs related to the service (#6611)
* Simplify a few chain components creation APIs related to the service * Fix basic-authorship doc tests * Remove DefaultQueue * Update client/service/src/builder.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> * Move ExecutionExtensions comment around * Remove unused BlakeTwo256 Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
use std::{convert::TryFrom, time::SystemTime};
|
||||
|
||||
use crate::NetworkStatus;
|
||||
use crate::{NetworkStatus, config::Configuration};
|
||||
use prometheus_endpoint::{register, Gauge, U64, F64, Registry, PrometheusError, Opts, GaugeVec};
|
||||
use sc_telemetry::{telemetry, SUBSTRATE_INFO};
|
||||
use sp_runtime::traits::{NumberFor, Block, SaturatedConversion, UniqueSaturatedInto};
|
||||
@@ -261,17 +261,17 @@ impl MetricsService {
|
||||
|
||||
|
||||
impl MetricsService {
|
||||
pub fn with_prometheus(registry: &Registry, name: &str, version: &str, role: &Role)
|
||||
pub fn with_prometheus(registry: &Registry, config: &Configuration)
|
||||
-> Result<Self, PrometheusError>
|
||||
{
|
||||
let role_bits = match role {
|
||||
let role_bits = match config.role {
|
||||
Role::Full => 1u64,
|
||||
Role::Light => 2u64,
|
||||
Role::Sentry { .. } => 3u64,
|
||||
Role::Authority { .. } => 4u64,
|
||||
};
|
||||
|
||||
PrometheusMetrics::setup(registry, name, version, role_bits).map(|p| {
|
||||
PrometheusMetrics::setup(registry, &config.network.node_name, &config.impl_version, role_bits).map(|p| {
|
||||
Self::inner_new(Some(p))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user