Package com.tnsai.quality.sampling
Record Class SamplingInput
java.lang.Object
java.lang.Record
com.tnsai.quality.sampling.SamplingInput
- Record Components:
eventKind- short stable identifier ("chat.chunk","llm.called","tool.invoked"); used for kind-specific ruleslevel- severity tier — drives default per-level ratescontext- enclosing framework context (tenant, agent, …) so tenant-aware policies can read tenant id
public record SamplingInput(String eventKind, com.tnsai.observability.events.EventLevel level, com.tnsai.observability.events.EventContext context)
extends Record
Frozen view of an event's metadata used by an
EventSamplingPolicy to decide whether to capture it (issue #82).
Decoupled from any specific event class so the SPI applies
uniformly to TnsAIEvent, the upcoming
AgentEvent hierarchy, or any custom event a consumer ships.
The publisher constructs a SamplingInput from the event
and feeds it to the policy.
- Since:
- 0.5.0 (issue #82)
-
Constructor Summary
ConstructorsConstructorDescriptionSamplingInput(String eventKind, com.tnsai.observability.events.EventLevel level, com.tnsai.observability.events.EventContext context) Creates an instance of aSamplingInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.tnsai.observability.events.EventContextcontext()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theeventKindrecord component.final inthashCode()Returns a hash code value for this object.com.tnsai.observability.events.EventLevellevel()Returns the value of thelevelrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SamplingInput
public SamplingInput(String eventKind, com.tnsai.observability.events.EventLevel level, com.tnsai.observability.events.EventContext context) Creates an instance of aSamplingInputrecord class.
-
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
eventKind
Returns the value of theeventKindrecord component.- Returns:
- the value of the
eventKindrecord component
-
level
public com.tnsai.observability.events.EventLevel level()Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
context
public com.tnsai.observability.events.EventContext context()Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-