Package com.tnsai.eval.hooks
Record Class EvalContext.MetricStats
java.lang.Object
java.lang.Record
com.tnsai.eval.hooks.EvalContext.MetricStats
- Enclosing class:
EvalContext
public static record EvalContext.MetricStats(String name, int count, double min, double max, double sum, double average, double p50, double p90, double p99)
extends Record
Statistics for a metric.
-
Constructor Summary
ConstructorsConstructorDescriptionMetricStats(String name, int count, double min, double max, double sum, double average, double p50, double p90, double p99) Creates an instance of aMetricStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleaverage()Returns the value of theaveragerecord component.static EvalContext.MetricStatsintcount()Returns the value of thecountrecord component.static EvalContext.MetricStatsfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublemax()Returns the value of themaxrecord component.doublemin()Returns the value of theminrecord component.name()Returns the value of thenamerecord component.doublep50()Returns the value of thep50record component.doublep90()Returns the value of thep90record component.doublep99()Returns the value of thep99record component.doublesum()Returns the value of thesumrecord component.toMap()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MetricStats
public MetricStats(String name, int count, double min, double max, double sum, double average, double p50, double p90, double p99) Creates an instance of aMetricStatsrecord class.- Parameters:
name- the value for thenamerecord componentcount- the value for thecountrecord componentmin- the value for theminrecord componentmax- the value for themaxrecord componentsum- the value for thesumrecord componentaverage- the value for theaveragerecord componentp50- the value for thep50record componentp90- the value for thep90record componentp99- the value for thep99record component
-
-
Method Details
-
empty
-
compute
-
toMap
-
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 '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
count
public int count()Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
min
public double min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
public double max()Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
sum
public double sum()Returns the value of thesumrecord component.- Returns:
- the value of the
sumrecord component
-
average
public double average()Returns the value of theaveragerecord component.- Returns:
- the value of the
averagerecord component
-
p50
public double p50()Returns the value of thep50record component.- Returns:
- the value of the
p50record component
-
p90
public double p90()Returns the value of thep90record component.- Returns:
- the value of the
p90record component
-
p99
public double p99()Returns the value of thep99record component.- Returns:
- the value of the
p99record component
-