Package com.tnsai.memory.strategy
Record Class ManagedConversationMemory.MemoryStats
java.lang.Object
java.lang.Record
com.tnsai.memory.strategy.ManagedConversationMemory.MemoryStats
- Enclosing class:
ManagedConversationMemory
public static record ManagedConversationMemory.MemoryStats(int rawMessageCount, int optimizedMessageCount, int rawTokenEstimate, int optimizedTokenEstimate, int optimizationCount, int totalMessagesProcessed, String strategyName)
extends Record
Memory statistics.
-
Constructor Summary
ConstructorsConstructorDescriptionMemoryStats(int rawMessageCount, int optimizedMessageCount, int rawTokenEstimate, int optimizedTokenEstimate, int optimizationCount, int totalMessagesProcessed, String strategyName) Creates an instance of aMemoryStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoublefinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theoptimizationCountrecord component.intReturns the value of theoptimizedMessageCountrecord component.intReturns the value of theoptimizedTokenEstimaterecord component.intReturns the value of therawMessageCountrecord component.intReturns the value of therawTokenEstimaterecord component.Returns the value of thestrategyNamerecord component.intfinal StringtoString()Returns a string representation of this record class.intReturns the value of thetotalMessagesProcessedrecord component.
-
Constructor Details
-
MemoryStats
public MemoryStats(int rawMessageCount, int optimizedMessageCount, int rawTokenEstimate, int optimizedTokenEstimate, int optimizationCount, int totalMessagesProcessed, String strategyName) Creates an instance of aMemoryStatsrecord class.- Parameters:
rawMessageCount- the value for therawMessageCountrecord componentoptimizedMessageCount- the value for theoptimizedMessageCountrecord componentrawTokenEstimate- the value for therawTokenEstimaterecord componentoptimizedTokenEstimate- the value for theoptimizedTokenEstimaterecord componentoptimizationCount- the value for theoptimizationCountrecord componenttotalMessagesProcessed- the value for thetotalMessagesProcessedrecord componentstrategyName- the value for thestrategyNamerecord component
-
-
Method Details
-
compressionRatio
public double compressionRatio() -
tokensSaved
public int tokensSaved() -
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 '=='. -
rawMessageCount
public int rawMessageCount()Returns the value of therawMessageCountrecord component.- Returns:
- the value of the
rawMessageCountrecord component
-
optimizedMessageCount
public int optimizedMessageCount()Returns the value of theoptimizedMessageCountrecord component.- Returns:
- the value of the
optimizedMessageCountrecord component
-
rawTokenEstimate
public int rawTokenEstimate()Returns the value of therawTokenEstimaterecord component.- Returns:
- the value of the
rawTokenEstimaterecord component
-
optimizedTokenEstimate
public int optimizedTokenEstimate()Returns the value of theoptimizedTokenEstimaterecord component.- Returns:
- the value of the
optimizedTokenEstimaterecord component
-
optimizationCount
public int optimizationCount()Returns the value of theoptimizationCountrecord component.- Returns:
- the value of the
optimizationCountrecord component
-
totalMessagesProcessed
public int totalMessagesProcessed()Returns the value of thetotalMessagesProcessedrecord component.- Returns:
- the value of the
totalMessagesProcessedrecord component
-
strategyName
Returns the value of thestrategyNamerecord component.- Returns:
- the value of the
strategyNamerecord component
-