Package com.tnsai.quality.slo
Record Class BurnRateConfig
java.lang.Object
java.lang.Record
com.tnsai.quality.slo.BurnRateConfig
public record BurnRateConfig(double shortWindowBurnRate, Duration shortWindow, double longWindowBurnRate, Duration longWindow)
extends Record
Multi-window burn-rate alerting thresholds (issue #92), per the SRE
workbook recipe — a single burn-rate signal is too noisy on its own,
so the framework requires a fast-window AND a slow-window signal to
fire before treating an SLO as actively burning.
Typical values from the SRE workbook for a 30-day SLO window:
shortWindow = 1h,shortWindowBurnRate = 14.4— alerts when 2% of the monthly budget would be consumed in 1hlongWindow = 6h,longWindowBurnRate = 6.0— alerts when 10% of the monthly budget would be consumed in 6h
- Since:
- 0.5.0 (issue #92)
-
Constructor Summary
ConstructorsConstructorDescriptionBurnRateConfig(double shortWindowBurnRate, Duration shortWindow, double longWindowBurnRate, Duration longWindow) Creates an instance of aBurnRateConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelongWindowrecord component.doubleReturns the value of thelongWindowBurnRaterecord component.Returns the value of theshortWindowrecord component.doubleReturns the value of theshortWindowBurnRaterecord component.static BurnRateConfigStandard SRE-workbook defaults for a 30-day window: 14.4× over 1h + 6× over 6h.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BurnRateConfig
public BurnRateConfig(double shortWindowBurnRate, Duration shortWindow, double longWindowBurnRate, Duration longWindow) Creates an instance of aBurnRateConfigrecord class.- Parameters:
shortWindowBurnRate- the value for theshortWindowBurnRaterecord componentshortWindow- the value for theshortWindowrecord componentlongWindowBurnRate- the value for thelongWindowBurnRaterecord componentlongWindow- the value for thelongWindowrecord component
-
-
Method Details
-
standardDefaults
Standard SRE-workbook defaults for a 30-day window: 14.4× over 1h + 6× over 6h. Use as a starting point and tune per-SLO from there. -
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 '=='. -
shortWindowBurnRate
public double shortWindowBurnRate()Returns the value of theshortWindowBurnRaterecord component.- Returns:
- the value of the
shortWindowBurnRaterecord component
-
shortWindow
Returns the value of theshortWindowrecord component.- Returns:
- the value of the
shortWindowrecord component
-
longWindowBurnRate
public double longWindowBurnRate()Returns the value of thelongWindowBurnRaterecord component.- Returns:
- the value of the
longWindowBurnRaterecord component
-
longWindow
Returns the value of thelongWindowrecord component.- Returns:
- the value of the
longWindowrecord component
-