Package com.tnsai.quality.sampling
Record Class RuleBasedSamplingPolicy.Rule
java.lang.Object
java.lang.Record
com.tnsai.quality.sampling.RuleBasedSamplingPolicy.Rule
- Record Components:
eventKindPattern- glob pattern, e.g."chat.*"minLevel- minimum severity that activates the ruletenantId- exact-match tenant filter; null = anyoutcome-RuleBasedSamplingPolicy.Outcomeaction when this rule firesrate- forRuleBasedSamplingPolicy.Outcome.SAMPLE_AT_RATEonly; 0..1 retention probability
- Enclosing class:
RuleBasedSamplingPolicy
public static record RuleBasedSamplingPolicy.Rule(String eventKindPattern, com.tnsai.observability.events.EventLevel minLevel, String tenantId, RuleBasedSamplingPolicy.Outcome outcome, double rate)
extends Record
One rule entry.
eventKindPattern is required; everything
else is optional (null = match anything).-
Constructor Summary
ConstructorsConstructorDescriptionRule(String eventKindPattern, com.tnsai.observability.events.EventLevel minLevel, String tenantId, RuleBasedSamplingPolicy.Outcome outcome, double rate) Creates an instance of aRulerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theeventKindPatternrecord component.final inthashCode()Returns a hash code value for this object.com.tnsai.observability.events.EventLevelminLevel()Returns the value of theminLevelrecord component.outcome()Returns the value of theoutcomerecord component.doublerate()Returns the value of theraterecord component.tenantId()Returns the value of thetenantIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Rule
public Rule(String eventKindPattern, com.tnsai.observability.events.EventLevel minLevel, String tenantId, RuleBasedSamplingPolicy.Outcome outcome, double rate) Creates an instance of aRulerecord class.- Parameters:
eventKindPattern- the value for theeventKindPatternrecord componentminLevel- the value for theminLevelrecord componenttenantId- the value for thetenantIdrecord componentoutcome- the value for theoutcomerecord componentrate- the value for theraterecord 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 '=='. -
eventKindPattern
Returns the value of theeventKindPatternrecord component.- Returns:
- the value of the
eventKindPatternrecord component
-
minLevel
public com.tnsai.observability.events.EventLevel minLevel()Returns the value of theminLevelrecord component.- Returns:
- the value of the
minLevelrecord component
-
tenantId
Returns the value of thetenantIdrecord component.- Returns:
- the value of the
tenantIdrecord component
-
outcome
Returns the value of theoutcomerecord component.- Returns:
- the value of the
outcomerecord component
-
rate
public double rate()Returns the value of theraterecord component.- Returns:
- the value of the
raterecord component
-