Package com.tnsai.llm.routing
Record Class LLMRouter.RoutingStats
java.lang.Object
java.lang.Record
com.tnsai.llm.routing.LLMRouter.RoutingStats
- Enclosing interface:
LLMRouter
public static record LLMRouter.RoutingStats(long totalRequests, long successfulRequests, long failedRequests, Map<String,Long> requestsPerProvider, Map<String,Long> failuresPerProvider, Map<String,Double> avgLatencyPerProvider)
extends Record
Records for routing statistics.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theavgLatencyPerProviderrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefailedRequestsrecord component.Returns the value of thefailuresPerProviderrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of therequestsPerProviderrecord component.longReturns the value of thesuccessfulRequestsrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalRequestsrecord component.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
RoutingStats
public RoutingStats(long totalRequests, long successfulRequests, long failedRequests, Map<String, Long> requestsPerProvider, Map<String, Long> failuresPerProvider, Map<String, Double> avgLatencyPerProvider) Creates an instance of aRoutingStatsrecord class.- Parameters:
totalRequests- the value for thetotalRequestsrecord componentsuccessfulRequests- the value for thesuccessfulRequestsrecord componentfailedRequests- the value for thefailedRequestsrecord componentrequestsPerProvider- the value for therequestsPerProviderrecord componentfailuresPerProvider- the value for thefailuresPerProviderrecord componentavgLatencyPerProvider- the value for theavgLatencyPerProviderrecord 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 '=='. -
totalRequests
public long totalRequests()Returns the value of thetotalRequestsrecord component.- Returns:
- the value of the
totalRequestsrecord component
-
successfulRequests
public long successfulRequests()Returns the value of thesuccessfulRequestsrecord component.- Returns:
- the value of the
successfulRequestsrecord component
-
failedRequests
public long failedRequests()Returns the value of thefailedRequestsrecord component.- Returns:
- the value of the
failedRequestsrecord component
-
requestsPerProvider
Returns the value of therequestsPerProviderrecord component.- Returns:
- the value of the
requestsPerProviderrecord component
-
failuresPerProvider
Returns the value of thefailuresPerProviderrecord component.- Returns:
- the value of the
failuresPerProviderrecord component
-
avgLatencyPerProvider
Returns the value of theavgLatencyPerProviderrecord component.- Returns:
- the value of the
avgLatencyPerProviderrecord component
-