Class SlaCalculationService
java.lang.Object
com.nmontytskyi.monitoring.server.sla.SlaCalculationService
Computes SLA compliance reports for registered microservices.
Only reads data — alert logic remains in AlertEvaluationService.
For each call it:
- resolves the requested time window (e.g. last 24 hours),
- queries aggregate counters and percentiles from
metric_records, - builds a
SlaReportwith actual values and compliance flags.
When no SlaDefinitionEntity has been created for the service,
SlaDefinition.defaults() is used (99.9% uptime, 1 000 ms, 5% errors).
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SlaCalculationService
public SlaCalculationService()
-
-
Method Details
-
calculate
Calculates an SLA report for the given service over the specified window.- Parameters:
serviceId- identifier of the registered servicewindow- time window over which to aggregate metrics- Returns:
- a fully populated
SlaReport - Throws:
ServiceNotFoundException- if no service exists withserviceId
-