mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 11:12:11 +01:00
docs: complete CSP metrics API documentation
- Add missing offset parameter to query parameters table - Document 10,000 violation entries hard cap for memory management - Ensure documentation matches all code examples - Clarify both time-based and count-based memory constraints Resolves inconsistency between examples and parameter documentation
This commit is contained in:
@ -64,6 +64,7 @@ GET /api/csp-metrics
|
||||
| `format` | string | Response format | `json` | `?format=csv` |
|
||||
| `groupBy` | string | Group results by field | `hour` | `?groupBy=directive` |
|
||||
| `includeDetails` | boolean | Include violation details | `false` | `?includeDetails=true` |
|
||||
| `offset` | string | Shift the queried time-window backwards by the given duration (for comparisons) | `0` | `?offset=24h` |
|
||||
|
||||
#### Time Range Options
|
||||
|
||||
@ -412,6 +413,7 @@ CSP_ALERT_THRESHOLD=5 # violations per 10 minutes
|
||||
### Memory Management
|
||||
|
||||
- **Violation buffer** limited to 7 days of data in memory
|
||||
- **Hard cap** of 10,000 violation entries to prevent memory exhaustion
|
||||
- **Automatic cleanup** runs every 100 requests (1% probability)
|
||||
- **Efficient storage** using Map data structures
|
||||
|
||||
|
||||
Reference in New Issue
Block a user