Class MetricsTimeSeriesController
java.lang.Object
com.nmontytskyi.monitoring.server.controller.MetricsTimeSeriesController
@RestController
@RequestMapping("/api/metrics")
public class MetricsTimeSeriesController
extends Object
REST controller exposing time-series metric data for chart rendering.
Returns per-service and system-wide metric history as ordered lists of time-point DTOs consumed by the Chart.js charts in the web UI. Also provides the anomaly record endpoint used by the anomaly list modal on the dashboard. Data is aggregated into 30-second buckets by the underlying native SQL queries.
- Author:
- Nazar Montytskyi
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRecentAnomalies(int minutes, int limit) getServiceHistory(Long serviceId, int minutes, int limit) getSystemHistory(int minutes, int limit)
-
Constructor Details
-
MetricsTimeSeriesController
public MetricsTimeSeriesController()
-
-
Method Details
-
getServiceHistory
@GetMapping("/{serviceId}/history") public List<MetricTimePointDTO> getServiceHistory(@PathVariable Long serviceId, @RequestParam(defaultValue="30") int minutes, @RequestParam(defaultValue="60") int limit) -
getSystemHistory
@GetMapping("/system/history") public List<SystemTimePointDTO> getSystemHistory(@RequestParam(defaultValue="30") int minutes, @RequestParam(defaultValue="60") int limit) -
getRecentAnomalies
@GetMapping("/anomalies") public List<AnomalyDTO> getRecentAnomalies(@RequestParam(defaultValue="30") int minutes, @RequestParam(defaultValue="100") int limit)
-