Package com.tnsai.quality.slo
Class SLORegistry
java.lang.Object
com.tnsai.quality.slo.SLORegistry
In-memory store of
SLODefinitions, looked up by id (issue #92).
The programmatic API foundation — a YAML config loader on top of this
lands in a follow-up.
Concurrency: backed by ConcurrentHashMap. all()
returns an immutable snapshot — callers iterate freely without
worrying about a concurrent register(com.tnsai.quality.slo.SLODefinition) mutating the list.
- Since:
- 0.5.0 (issue #92)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionall()Snapshot of every registered SLO.voidclear()Look up an SLO by id.findApplicable(EventScope eventScope) Find every SLO whose scope matches the given event scope — used by the (follow-up)SLOAwareHookto figure out which SLOs apply to an in-flight call.voidregister(SLODefinition definition) Register a new SLO.voidregisterAll(List<SLODefinition> defs) Convenience: register many at once.voidRemove an SLO.intsize()
-
Constructor Details
-
SLORegistry
public SLORegistry()
-
-
Method Details
-
register
Register a new SLO. If an SLO with the same id already exists, it is replaced — useful for hot-reload scenarios. -
registerAll
Convenience: register many at once. -
find
Look up an SLO by id. -
remove
Remove an SLO. No-op when the id is unknown. -
all
Snapshot of every registered SLO. Immutable; safe to iterate concurrently withregister(com.tnsai.quality.slo.SLODefinition). -
findApplicable
Find every SLO whose scope matches the given event scope — used by the (follow-up)SLOAwareHookto figure out which SLOs apply to an in-flight call. -
size
public int size() -
clear
public void clear()
-