Files
dashback/docs/api/routes/health/latency.md
2026-10-19 01:53:25 +02:00

52 lines
1.2 KiB
Markdown

# `GET /health/latency`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Health latency history
Returns the database healthcheck latency (ms), each series oldest first with unix-ms timestamps. By default (`range=3h`) only `raw` is returned, the per-minute samples of the last 3 hours. With `range=all` the 30-day `avg` and `max` series (30-minute aggregates over the last 4 hours of samples) are included as well. Requires a valid JWT; no company selection needed.
## Query parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `range` | no | string | `3h` (default) returns only the per-minute samples of the last 3 hours; `all` also includes the 30-day avg and max series. |
## Response `200`
Latency series
```json
{
"raw": [
{
"timestamp": 1,
"value": 1
}
],
"avg": [
{
"timestamp": 1,
"value": 1
}
],
"max": [
{
"timestamp": 1,
"value": 1
}
]
}
```
## Errors
| Status | Description |
|--------|-------------|
| 401 | Unauthorized |
| 500 | Redis read failed |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._