pub async fn pool_stats(pool: Data<SharedPool>) -> impl ResponderExpand 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
}| Field | Type | Description |
|---|---|---|
available | number | Browsers ready to handle requests |
active | number | Browsers currently in use |
total | number | Total browsers (available + active) |
§Errors
| Status | Code | Description |
|---|---|---|
| 500 | POOL_LOCK_FAILED | Failed to acquire pool lock |
§Use Cases
- Monitoring dashboards
- Prometheus/Grafana metrics
- Capacity planning
- Debugging pool exhaustion
§Usage in App
ⓘ
App::new()
.app_data(web::Data::new(pool.clone()))
.route("/pool/stats", web::get().to(pool_stats))