Package com.tnsai.quality.slo
Record Class SLOState
java.lang.Object
java.lang.Record
com.tnsai.quality.slo.SLOState
- Record Components:
definition- the SLO this state describescurrentCompliance- observed compliance percentage in [0,100]errorBudgetRemaining- fraction of the budget left, in [0,1] — 1.0 means full budget, 0.0 means exhaustedburn- burn-rate sample for this SLOstatus- coarse status bucketevaluatedAt- when the snapshot was taken
public record SLOState(SLODefinition definition, double currentCompliance, double errorBudgetRemaining, BurnRateMetric burn, SLOStatus status, Instant evaluatedAt)
extends Record
Point-in-time snapshot of an SLO's health, produced by
SLOEvaluator.evaluate(SLODefinition, Instant) (issue #92).- Since:
- 0.5.0 (issue #92)
-
Constructor Summary
ConstructorsConstructorDescriptionSLOState(SLODefinition definition, double currentCompliance, double errorBudgetRemaining, BurnRateMetric burn, SLOStatus status, Instant evaluatedAt) Creates an instance of aSLOStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionburn()Returns the value of theburnrecord component.doubleReturns the value of thecurrentCompliancerecord component.Returns the value of thedefinitionrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of theerrorBudgetRemainingrecord component.Returns the value of theevaluatedAtrecord component.final inthashCode()Returns a hash code value for this object.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SLOState
public SLOState(SLODefinition definition, double currentCompliance, double errorBudgetRemaining, BurnRateMetric burn, SLOStatus status, Instant evaluatedAt) Creates an instance of aSLOStaterecord class.- Parameters:
definition- the value for thedefinitionrecord componentcurrentCompliance- the value for thecurrentCompliancerecord componenterrorBudgetRemaining- the value for theerrorBudgetRemainingrecord componentburn- the value for theburnrecord componentstatus- the value for thestatusrecord componentevaluatedAt- the value for theevaluatedAtrecord component
-
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
definition
Returns the value of thedefinitionrecord component.- Returns:
- the value of the
definitionrecord component
-
currentCompliance
public double currentCompliance()Returns the value of thecurrentCompliancerecord component.- Returns:
- the value of the
currentCompliancerecord component
-
errorBudgetRemaining
public double errorBudgetRemaining()Returns the value of theerrorBudgetRemainingrecord component.- Returns:
- the value of the
errorBudgetRemainingrecord component
-
burn
Returns the value of theburnrecord component.- Returns:
- the value of the
burnrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
evaluatedAt
Returns the value of theevaluatedAtrecord component.- Returns:
- the value of the
evaluatedAtrecord component
-