Package com.tnsai.quality.slo
Record Class InMemorySLOEvaluator.Attempt
java.lang.Object
java.lang.Record
com.tnsai.quality.slo.InMemorySLOEvaluator.Attempt
- Enclosing class:
InMemorySLOEvaluator
public static record InMemorySLOEvaluator.Attempt(EventScope scope, boolean success, long latencyMs, Instant at)
extends Record
One observed attempt feeding the SLO calculation.
latencyMs
is required for SLOType.LATENCY SLOs and ignored otherwise;
pass 0 when irrelevant.-
Constructor Summary
ConstructorsConstructorDescriptionAttempt(EventScope scope, boolean success, long latencyMs, Instant at) Creates an instance of aAttemptrecord class. -
Method Summary
Modifier and TypeMethodDescriptionat()Returns the value of theatrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thelatencyMsrecord component.scope()Returns the value of thescoperecord component.booleansuccess()Returns the value of thesuccessrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Attempt
Creates an instance of aAttemptrecord class.- Parameters:
scope- the value for thescoperecord componentsuccess- the value for thesuccessrecord componentlatencyMs- the value for thelatencyMsrecord componentat- the value for theatrecord 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 '=='. -
scope
Returns the value of thescoperecord component.- Returns:
- the value of the
scoperecord component
-
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
latencyMs
public long latencyMs()Returns the value of thelatencyMsrecord component.- Returns:
- the value of the
latencyMsrecord component
-
at
Returns the value of theatrecord component.- Returns:
- the value of the
atrecord component
-