Module metrics

Module metrics 

Source
Expand description

Performance metrics for stygian-browser.

Tracks browser pool utilisation, acquisition latency, crash rates, and process memory. Metrics are exported in Prometheus text format via gather.

§Enabling

[dependencies]
stygian-browser = { version = "0.1", features = ["metrics"] }

§Example

use stygian_browser::metrics::{gather, METRICS};

// After your scraping loop:
let report = gather();
println!("{report}");

§Prometheus metrics

NameTypeDescription
browser_pool_sizeGaugeNumber of active browser instances
browser_acquisition_duration_secondsHistogramTime to acquire a browser
browser_crashes_totalCounterCumulative browser crashes
process_rss_bytesGaugeProcess resident set size (Linux only)

Structs§

BrowserMetrics
Global Prometheus metrics for the browser pool.

Statics§

METRICS
Global metrics instance.

Functions§

gather
Convenience alias for METRICS.gather().