Record Class CanaryPolicy
java.lang.Object
java.lang.Record
org.j7m.middleware.cluster.CanaryPolicy
- Record Components:
revision- monotonically increasing policy revisionbaseline- compatible fallback release identitycanary- candidate release identitycanaryWeight- candidate exposure, 0..10000 basis pointsminimumSamples- required candidate observations, 1..1000000maximumErrorRate- tolerated candidate error fraction, 0..1maximumMeanLatencyMillis- tolerated arithmetic mean candidate latency, positive millisecondsmaximumProbeAgeMillis- maximum observation age, 1..60000 milliseconds
public record CanaryPolicy(long revision, String baseline, String canary, int canaryWeight, long minimumSamples, double maximumErrorRate, long maximumMeanLatencyMillis, long maximumProbeAgeMillis)
extends Record
Immutable traffic and observation policy. Weights are basis points, not a customer SLO.
Routing is stable for one policy revision; changing revisions may deliberately reroute retries.
Applications must preserve their own idempotent request identities across deployment changes.
-
Constructor Summary
ConstructorsConstructorDescriptionCanaryPolicy(long revision, String baseline, String canary, int canaryWeight, long minimumSamples, double maximumErrorRate, long maximumMeanLatencyMillis, long maximumProbeAgeMillis) Validates identities and finite thresholds before any mutation. -
Method Summary
Modifier and TypeMethodDescriptionbaseline()Returns the value of thebaselinerecord component.canary()Returns the value of thecanaryrecord component.intReturns the value of thecanaryWeightrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of themaximumErrorRaterecord component.longReturns the value of themaximumMeanLatencyMillisrecord component.longReturns the value of themaximumProbeAgeMillisrecord component.longReturns the value of theminimumSamplesrecord component.longrevision()Returns the value of therevisionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CanaryPolicy
public CanaryPolicy(long revision, String baseline, String canary, int canaryWeight, long minimumSamples, double maximumErrorRate, long maximumMeanLatencyMillis, long maximumProbeAgeMillis) Validates identities and finite thresholds before any mutation.- Parameters:
revision- positive revisionbaseline- fallback releasecanary- distinct candidate releasecanaryWeight- basis pointsminimumSamples- candidate sample thresholdmaximumErrorRate- finite error fractionmaximumMeanLatencyMillis- positive latency thresholdmaximumProbeAgeMillis- bounded freshness threshold- Throws:
IllegalArgumentException- if an identity or bound is invalid
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
revision
-
baseline
-
canary
-
canaryWeight
public int canaryWeight()Returns the value of thecanaryWeightrecord component.- Returns:
- the value of the
canaryWeightrecord component
-
minimumSamples
public long minimumSamples()Returns the value of theminimumSamplesrecord component.- Returns:
- the value of the
minimumSamplesrecord component
-
maximumErrorRate
public double maximumErrorRate()Returns the value of themaximumErrorRaterecord component.- Returns:
- the value of the
maximumErrorRaterecord component
-
maximumMeanLatencyMillis
public long maximumMeanLatencyMillis()Returns the value of themaximumMeanLatencyMillisrecord component.- Returns:
- the value of the
maximumMeanLatencyMillisrecord component
-
maximumProbeAgeMillis
public long maximumProbeAgeMillis()Returns the value of themaximumProbeAgeMillisrecord component.- Returns:
- the value of the
maximumProbeAgeMillisrecord component
-