Package com.tnsai.llm.observability
Record Class LLMMetrics.Report
java.lang.Object
java.lang.Record
com.tnsai.llm.observability.LLMMetrics.Report
- Enclosing class:
LLMMetrics
public static record LLMMetrics.Report(long totalRequests, long totalResponses, long totalErrors, long totalInputTokens, long totalOutputTokens, double totalEstimatedCost, double avgLatencyMs, double p50LatencyMs, double p95LatencyMs, double p99LatencyMs, Instant timestamp)
extends Record
Comprehensive metrics report.
-
Constructor Summary
ConstructorsConstructorDescriptionReport(long totalRequests, long totalResponses, long totalErrors, long totalInputTokens, long totalOutputTokens, double totalEstimatedCost, double avgLatencyMs, double p50LatencyMs, double p95LatencyMs, double p99LatencyMs, Instant timestamp) Creates an instance of aReportrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theavgLatencyMsrecord component.final booleanIndicates whether some other object is "equal to" this one.doublefinal inthashCode()Returns a hash code value for this object.doubleReturns the value of thep50LatencyMsrecord component.doubleReturns the value of thep95LatencyMsrecord component.doubleReturns the value of thep99LatencyMsrecord component.doubleReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalErrorsrecord component.doubleReturns the value of thetotalEstimatedCostrecord component.longReturns the value of thetotalInputTokensrecord component.longReturns the value of thetotalOutputTokensrecord component.longReturns the value of thetotalRequestsrecord component.longReturns the value of thetotalResponsesrecord component.
-
Constructor Details
-
Report
public Report(long totalRequests, long totalResponses, long totalErrors, long totalInputTokens, long totalOutputTokens, double totalEstimatedCost, double avgLatencyMs, double p50LatencyMs, double p95LatencyMs, double p99LatencyMs, Instant timestamp) Creates an instance of aReportrecord class.- Parameters:
totalRequests- the value for thetotalRequestsrecord componenttotalResponses- the value for thetotalResponsesrecord componenttotalErrors- the value for thetotalErrorsrecord componenttotalInputTokens- the value for thetotalInputTokensrecord componenttotalOutputTokens- the value for thetotalOutputTokensrecord componenttotalEstimatedCost- the value for thetotalEstimatedCostrecord componentavgLatencyMs- the value for theavgLatencyMsrecord componentp50LatencyMs- the value for thep50LatencyMsrecord componentp95LatencyMs- the value for thep95LatencyMsrecord componentp99LatencyMs- the value for thep99LatencyMsrecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
successRate
public double successRate() -
errorRate
public double errorRate() -
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 '=='. -
totalRequests
public long totalRequests()Returns the value of thetotalRequestsrecord component.- Returns:
- the value of the
totalRequestsrecord component
-
totalResponses
public long totalResponses()Returns the value of thetotalResponsesrecord component.- Returns:
- the value of the
totalResponsesrecord component
-
totalErrors
public long totalErrors()Returns the value of thetotalErrorsrecord component.- Returns:
- the value of the
totalErrorsrecord component
-
totalInputTokens
public long totalInputTokens()Returns the value of thetotalInputTokensrecord component.- Returns:
- the value of the
totalInputTokensrecord component
-
totalOutputTokens
public long totalOutputTokens()Returns the value of thetotalOutputTokensrecord component.- Returns:
- the value of the
totalOutputTokensrecord component
-
totalEstimatedCost
public double totalEstimatedCost()Returns the value of thetotalEstimatedCostrecord component.- Returns:
- the value of the
totalEstimatedCostrecord component
-
avgLatencyMs
public double avgLatencyMs()Returns the value of theavgLatencyMsrecord component.- Returns:
- the value of the
avgLatencyMsrecord component
-
p50LatencyMs
public double p50LatencyMs()Returns the value of thep50LatencyMsrecord component.- Returns:
- the value of the
p50LatencyMsrecord component
-
p95LatencyMs
public double p95LatencyMs()Returns the value of thep95LatencyMsrecord component.- Returns:
- the value of the
p95LatencyMsrecord component
-
p99LatencyMs
public double p99LatencyMs()Returns the value of thep99LatencyMsrecord component.- Returns:
- the value of the
p99LatencyMsrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-