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

    Constructors
    Constructor
    Description
    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 a Report record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the avgLatencyMs record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
     
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the p50LatencyMs record component.
    double
    Returns the value of the p95LatencyMs record component.
    double
    Returns the value of the p99LatencyMs record component.
    double
     
    Returns the value of the timestamp record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the totalErrors record component.
    double
    Returns the value of the totalEstimatedCost record component.
    long
    Returns the value of the totalInputTokens record component.
    long
    Returns the value of the totalOutputTokens record component.
    long
    Returns the value of the totalRequests record component.
    long
    Returns the value of the totalResponses record component.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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 a Report record class.
      Parameters:
      totalRequests - the value for the totalRequests record component
      totalResponses - the value for the totalResponses record component
      totalErrors - the value for the totalErrors record component
      totalInputTokens - the value for the totalInputTokens record component
      totalOutputTokens - the value for the totalOutputTokens record component
      totalEstimatedCost - the value for the totalEstimatedCost record component
      avgLatencyMs - the value for the avgLatencyMs record component
      p50LatencyMs - the value for the p50LatencyMs record component
      p95LatencyMs - the value for the p95LatencyMs record component
      p99LatencyMs - the value for the p99LatencyMs record component
      timestamp - the value for the timestamp record component
  • Method Details

    • successRate

      public double successRate()
    • errorRate

      public double errorRate()
    • 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.
    • totalRequests

      public long totalRequests()
      Returns the value of the totalRequests record component.
      Returns:
      the value of the totalRequests record component
    • totalResponses

      public long totalResponses()
      Returns the value of the totalResponses record component.
      Returns:
      the value of the totalResponses record component
    • totalErrors

      public long totalErrors()
      Returns the value of the totalErrors record component.
      Returns:
      the value of the totalErrors record component
    • totalInputTokens

      public long totalInputTokens()
      Returns the value of the totalInputTokens record component.
      Returns:
      the value of the totalInputTokens record component
    • totalOutputTokens

      public long totalOutputTokens()
      Returns the value of the totalOutputTokens record component.
      Returns:
      the value of the totalOutputTokens record component
    • totalEstimatedCost

      public double totalEstimatedCost()
      Returns the value of the totalEstimatedCost record component.
      Returns:
      the value of the totalEstimatedCost record component
    • avgLatencyMs

      public double avgLatencyMs()
      Returns the value of the avgLatencyMs record component.
      Returns:
      the value of the avgLatencyMs record component
    • p50LatencyMs

      public double p50LatencyMs()
      Returns the value of the p50LatencyMs record component.
      Returns:
      the value of the p50LatencyMs record component
    • p95LatencyMs

      public double p95LatencyMs()
      Returns the value of the p95LatencyMs record component.
      Returns:
      the value of the p95LatencyMs record component
    • p99LatencyMs

      public double p99LatencyMs()
      Returns the value of the p99LatencyMs record component.
      Returns:
      the value of the p99LatencyMs record component
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component