implemented 09-system-metrics.md: added system metrics: introduced system monitoring with a metrics collector, REST API endpoint, Thymeleaf UI rendering, and lifecycle management

This commit is contained in:
Michael Hoennig
2026-07-07 12:55:11 +02:00
parent 67c9f0ade9
commit a6a2c9de0b
21 changed files with 1069 additions and 6 deletions
@@ -0,0 +1,18 @@
package de.hoennig.gittally.server
import de.hoennig.gittally.metrics.SystemMetrics
import de.hoennig.gittally.metrics.SystemMetricsCollector
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController
@RestController
class SystemApiController(
private val collector: SystemMetricsCollector,
) {
/**
* The current system snapshot plus min/max/avg aggregates (the legacy
* `system.json`). Unavailable metrics are null, never an error.
*/
@GetMapping("/api/system")
fun system(): SystemMetrics = collector.snapshot()
}