pub struct Profiler {
pub start_time: OnceLock<Instant>,
pub kernel_load_duration: Mutex<Option<Duration>>,
pub plugins_load_duration: Mutex<Option<Duration>>,
pub total_http_nanos: AtomicU64,
pub http_requests_count: AtomicUsize,
pub http_retries_count: AtomicUsize,
pub enabled: AtomicBool,
}Expand description
Global Profiler state.
Uses AtomicU64 for hot-path counters (HTTP duration, request/retry counts)
to avoid mutex contention during concurrent multipart uploads.
Mutex<Option<Duration>> is retained for one-shot milestone markers
(kernel/plugins load) which are written at most once.
Note: const fn constructors for Mutex, OnceLock, and atomics
require Rust 1.63+ / 1.70+ respectively. This crate requires Rust 1.88+.
Fields§
§start_time: OnceLock<Instant>§kernel_load_duration: Mutex<Option<Duration>>§plugins_load_duration: Mutex<Option<Duration>>§total_http_nanos: AtomicU64Accumulated HTTP network duration in nanoseconds (lock-free).
http_requests_count: AtomicUsizeNumber of logical HTTP requests (one per send_with_retry call).
http_retries_count: AtomicUsizeNumber of HTTP retry attempts (retries only, not initial attempts).
enabled: AtomicBoolAuto Trait Implementations§
impl !Freeze for Profiler
impl RefUnwindSafe for Profiler
impl Send for Profiler
impl Sync for Profiler
impl Unpin for Profiler
impl UnsafeUnpin for Profiler
impl UnwindSafe for Profiler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more