pool_stats

Function pool_stats 

Source
pub fn pool_stats(
    pool: &State<SharedPool>,
) -> HandlerResult<Json<PoolStatsResponse>>
Expand description

Get browser pool statistics.

Returns real-time metrics about the browser pool including available browsers, active browsers, and total count.

§Endpoint

GET /pool/stats

§Response (200 OK)

{
    "available": 3,
    "active": 2,
    "total": 5
}
FieldTypeDescription
availablenumberBrowsers ready to handle requests
activenumberBrowsers currently in use
totalnumberTotal browsers (available + active)

§Errors

StatusCodeDescription
500POOL_LOCK_FAILEDFailed to acquire pool lock

§Use Cases

  • Monitoring dashboards
  • Prometheus/Grafana metrics
  • Capacity planning
  • Debugging pool exhaustion

§Usage in App

rocket::build()
    .manage(pool)
    .mount("/", routes![pool_stats])