Package com.tnsai.llm.routing
Record Class LatencyBasedRouter.LatencyStats
java.lang.Object
java.lang.Record
com.tnsai.llm.routing.LatencyBasedRouter.LatencyStats
- Enclosing class:
LatencyBasedRouter
public static record LatencyBasedRouter.LatencyStats(Map<String,Double> avgLatencyPerProvider, String fastestProvider, double fastestLatencyMs)
extends Record
Latency statistics.
-
Constructor Summary
ConstructorsConstructorDescriptionLatencyStats(Map<String, Double> avgLatencyPerProvider, String fastestProvider, double fastestLatencyMs) Creates an instance of aLatencyStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theavgLatencyPerProviderrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of thefastestLatencyMsrecord component.Returns the value of thefastestProviderrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LatencyStats
public LatencyStats(Map<String, Double> avgLatencyPerProvider, String fastestProvider, double fastestLatencyMs) Creates an instance of aLatencyStatsrecord class.- Parameters:
avgLatencyPerProvider- the value for theavgLatencyPerProviderrecord componentfastestProvider- the value for thefastestProviderrecord componentfastestLatencyMs- the value for thefastestLatencyMsrecord 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 '=='. -
avgLatencyPerProvider
Returns the value of theavgLatencyPerProviderrecord component.- Returns:
- the value of the
avgLatencyPerProviderrecord component
-
fastestProvider
Returns the value of thefastestProviderrecord component.- Returns:
- the value of the
fastestProviderrecord component
-
fastestLatencyMs
public double fastestLatencyMs()Returns the value of thefastestLatencyMsrecord component.- Returns:
- the value of the
fastestLatencyMsrecord component
-