mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 05:51:02 +00:00
Pass startup_time to telemetry (#4069)
This commit is contained in:
committed by
Gavin Wood
parent
b5469c6e0c
commit
f90fd34f81
@@ -44,7 +44,10 @@ use sr_primitives::traits::{
|
|||||||
Block as BlockT, Extrinsic, ProvideRuntimeApi, NumberFor, One, Zero, Header, SaturatedConversion
|
Block as BlockT, Extrinsic, ProvideRuntimeApi, NumberFor, One, Zero, Header, SaturatedConversion
|
||||||
};
|
};
|
||||||
use substrate_executor::{NativeExecutor, NativeExecutionDispatch};
|
use substrate_executor::{NativeExecutor, NativeExecutionDispatch};
|
||||||
use std::{io::{Read, Write, Seek}, marker::PhantomData, sync::Arc, sync::atomic::AtomicBool};
|
use std::{
|
||||||
|
io::{Read, Write, Seek},
|
||||||
|
marker::PhantomData, sync::Arc, sync::atomic::AtomicBool, time::SystemTime
|
||||||
|
};
|
||||||
use sysinfo::{get_current_pid, ProcessExt, System, SystemExt};
|
use sysinfo::{get_current_pid, ProcessExt, System, SystemExt};
|
||||||
use tel::{telemetry, SUBSTRATE_INFO};
|
use tel::{telemetry, SUBSTRATE_INFO};
|
||||||
use transaction_pool::txpool::{self, ChainApi, Pool as TransactionPool};
|
use transaction_pool::txpool::{self, ChainApi, Pool as TransactionPool};
|
||||||
@@ -187,7 +190,7 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
|
|||||||
client_db::DatabaseSettingsSrc::Custom(db.clone()),
|
client_db::DatabaseSettingsSrc::Custom(db.clone()),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
client_db::new_client(
|
client_db::new_client(
|
||||||
db_config,
|
db_config,
|
||||||
executor,
|
executor,
|
||||||
@@ -1095,6 +1098,9 @@ ServiceBuilder<
|
|||||||
endpoints,
|
endpoints,
|
||||||
wasm_external_transport: config.telemetry_external_transport.take(),
|
wasm_external_transport: config.telemetry_external_transport.take(),
|
||||||
});
|
});
|
||||||
|
let startup_time = SystemTime::UNIX_EPOCH.elapsed()
|
||||||
|
.map(|dur| dur.as_millis())
|
||||||
|
.unwrap_or(0);
|
||||||
let future = telemetry.clone()
|
let future = telemetry.clone()
|
||||||
.map(|ev| Ok::<_, ()>(ev))
|
.map(|ev| Ok::<_, ()>(ev))
|
||||||
.compat()
|
.compat()
|
||||||
@@ -1109,6 +1115,7 @@ ServiceBuilder<
|
|||||||
"config" => "",
|
"config" => "",
|
||||||
"chain" => chain_name.clone(),
|
"chain" => chain_name.clone(),
|
||||||
"authority" => is_authority,
|
"authority" => is_authority,
|
||||||
|
"startup_time" => startup_time,
|
||||||
"network_id" => network_id.clone()
|
"network_id" => network_id.clone()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user