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 rule
tenantId - exact-match tenant filter; null = any
outcome - RuleBasedSamplingPolicy.Outcome action when this rule fires
rate - for RuleBasedSamplingPolicy.Outcome.SAMPLE_AT_RATE only; 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 Details

    • Rule

      public Rule(String eventKindPattern, com.tnsai.observability.events.EventLevel minLevel, String tenantId, RuleBasedSamplingPolicy.Outcome outcome, double rate)
      Creates an instance of a Rule record class.
      Parameters:
      eventKindPattern - the value for the eventKindPattern record component
      minLevel - the value for the minLevel record component
      tenantId - the value for the tenantId record component
      outcome - the value for the outcome record component
      rate - the value for the rate record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • eventKindPattern

      public String eventKindPattern()
      Returns the value of the eventKindPattern record component.
      Returns:
      the value of the eventKindPattern record component
    • minLevel

      public com.tnsai.observability.events.EventLevel minLevel()
      Returns the value of the minLevel record component.
      Returns:
      the value of the minLevel record component
    • tenantId

      public String tenantId()
      Returns the value of the tenantId record component.
      Returns:
      the value of the tenantId record component
    • outcome

      Returns the value of the outcome record component.
      Returns:
      the value of the outcome record component
    • rate

      public double rate()
      Returns the value of the rate record component.
      Returns:
      the value of the rate record component