#[cfg(feature = "external")] use crate::Pacer; use crate::{ BlobLayout, BlobVersion, Clock, Error, Execution, Handle, METRICS_PREFIX, Name, SinkOf, StreamOf, child_label, network::{ metered::Network as MeteredNetwork, tokio::{Config as TokioNetworkConfig, Network as TokioNetwork}, }, prefixed_name, process::metered::Metrics as MeteredProcess, signal::Signal, storage::{ metered::Storage as MeteredStorage, tokio::{Config as TokioStorageConfig, Storage as TokioStorage}, }, telemetry::metrics::{ CounterFamily, GaugeFamily, Metric, Register, Registered, Registry, add_attribute, raw, task::Label, validate_label, }, utils::{self, FactoryGuard, Panicker, signal::Stopper, supervision::Tree}, }; use commonware_macros::{select, stability}; #[stability(BETA)] use commonware_parallel::{Rayon, rayon::ThreadPoolBuilder}; use commonware_utils::{sync::Mutex, sys_rng}; use governor::clock::{Clock as GClock, ReasonablyRealtime}; use rand_core::{Rng, TryCryptoRng, TryRng}; use std::{ convert::Infallible, env, future::{Future, poll_fn}, net::{IpAddr, SocketAddr}, num::NonZeroUsize, ops::RangeInclusive, panic::{AssertUnwindSafe, catch_unwind, resume_unwind}, path::PathBuf, pin::pin, sync::Arc, task::Poll, time::{Duration, SystemTime}, }; use tokio::{ runtime::{Builder, Handle as RuntimeHandle}, sync::Notify, }; #[derive(Debug)] struct Metrics { tasks_spawned: CounterFamily