pub struct BrowserMetrics {
pub pool_size: Gauge,
pub acquisition_duration_seconds: Histogram,
pub crashes_total: Counter,
pub process_rss_bytes: Gauge,
/* private fields */
}Expand description
Global Prometheus metrics for the browser pool.
Obtain a reference via the METRICS static.
Fields§
§pool_size: GaugeActive browser instance count.
acquisition_duration_seconds: HistogramHistogram of browser acquisition durations in seconds.
crashes_total: CounterTotal browser crashes (unexpected terminations or health-check failures).
process_rss_bytes: GaugeProcess RSS in bytes (Linux only; 0 on other platforms).
Implementations§
Source§impl BrowserMetrics
impl BrowserMetrics
Sourcepub fn record_acquisition(&self, duration: Duration)
pub fn record_acquisition(&self, duration: Duration)
Record a browser acquisition that took duration.
Emits a warning if duration exceeds the 1-second performance budget.
Logs an error if the crash rate exceeds 10%.
Sourcepub fn set_pool_size(&self, active: i64)
pub fn set_pool_size(&self, active: i64)
Update the pool size gauge.
Sourcepub fn record_crash(&self)
pub fn record_crash(&self)
Record a browser crash or health-check failure.
Sourcepub fn refresh_rss(&self) -> i64
pub fn refresh_rss(&self) -> i64
Refresh the process RSS gauge and return the current value in bytes.
Returns 0 on platforms where /proc/self/status is unavailable.
Auto Trait Implementations§
impl !Freeze for BrowserMetrics
impl !RefUnwindSafe for BrowserMetrics
impl Send for BrowserMetrics
impl Sync for BrowserMetrics
impl Unpin for BrowserMetrics
impl !UnwindSafe for BrowserMetrics
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