Package com.tnsai.quality.slo
Record Class SLODefinition
java.lang.Object
java.lang.Record
com.tnsai.quality.slo.SLODefinition
public record SLODefinition(String id, String name, SLOScope scope, SLOType type, Target target, Duration window, Optional<BurnRateConfig> burnRate)
extends Record
Declarative definition of one Service Level Objective (issue #92).
Combines what to measure (SLOType + Target), where to
measure it (SLOScope), how long to look back (window),
and how aggressively to alert on burn rate
(Optional<BurnRateConfig>). The
SLOEvaluator consumes one of these to compute current
SLOState.
Definitions are immutable — reload by replacing the
SLORegistry entry rather than mutating in place.
- Since:
- 0.5.0 (issue #92)
-
Constructor Summary
ConstructorsConstructorDescriptionConvenience: definition without burn-rate alerting.SLODefinition(String id, String name, SLOScope scope, SLOType type, Target target, Duration window, Optional<BurnRateConfig> burnRate) Creates an instance of aSLODefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionburnRate()Returns the value of theburnRaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.name()Returns the value of thenamerecord component.scope()Returns the value of thescoperecord component.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.window()Returns the value of thewindowrecord component.
-
Constructor Details
-
SLODefinition
public SLODefinition(String id, String name, SLOScope scope, SLOType type, Target target, Duration window, Optional<BurnRateConfig> burnRate) Creates an instance of aSLODefinitionrecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentscope- the value for thescoperecord componenttype- the value for thetyperecord componenttarget- the value for thetargetrecord componentwindow- the value for thewindowrecord componentburnRate- the value for theburnRaterecord component
-
SLODefinition
public SLODefinition(String id, String name, SLOScope scope, SLOType type, Target target, Duration window) Convenience: definition without burn-rate alerting.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
scope
Returns the value of thescoperecord component.- Returns:
- the value of the
scoperecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
window
Returns the value of thewindowrecord component.- Returns:
- the value of the
windowrecord component
-
burnRate
Returns the value of theburnRaterecord component.- Returns:
- the value of the
burnRaterecord component
-