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

    Constructors
    Constructor
    Description
    MemoryStats(int rawMessageCount, int optimizedMessageCount, int rawTokenEstimate, int optimizedTokenEstimate, int optimizationCount, int totalMessagesProcessed, String strategyName)
    Creates an instance of a MemoryStats record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the optimizationCount record component.
    int
    Returns the value of the optimizedMessageCount record component.
    int
    Returns the value of the optimizedTokenEstimate record component.
    int
    Returns the value of the rawMessageCount record component.
    int
    Returns the value of the rawTokenEstimate record component.
    Returns the value of the strategyName record component.
    int
     
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the totalMessagesProcessed record component.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MemoryStats

      public MemoryStats(int rawMessageCount, int optimizedMessageCount, int rawTokenEstimate, int optimizedTokenEstimate, int optimizationCount, int totalMessagesProcessed, String strategyName)
      Creates an instance of a MemoryStats record class.
      Parameters:
      rawMessageCount - the value for the rawMessageCount record component
      optimizedMessageCount - the value for the optimizedMessageCount record component
      rawTokenEstimate - the value for the rawTokenEstimate record component
      optimizedTokenEstimate - the value for the optimizedTokenEstimate record component
      optimizationCount - the value for the optimizationCount record component
      totalMessagesProcessed - the value for the totalMessagesProcessed record component
      strategyName - the value for the strategyName record component
  • Method Details

    • compressionRatio

      public double compressionRatio()
    • tokensSaved

      public int tokensSaved()
    • 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.
    • rawMessageCount

      public int rawMessageCount()
      Returns the value of the rawMessageCount record component.
      Returns:
      the value of the rawMessageCount record component
    • optimizedMessageCount

      public int optimizedMessageCount()
      Returns the value of the optimizedMessageCount record component.
      Returns:
      the value of the optimizedMessageCount record component
    • rawTokenEstimate

      public int rawTokenEstimate()
      Returns the value of the rawTokenEstimate record component.
      Returns:
      the value of the rawTokenEstimate record component
    • optimizedTokenEstimate

      public int optimizedTokenEstimate()
      Returns the value of the optimizedTokenEstimate record component.
      Returns:
      the value of the optimizedTokenEstimate record component
    • optimizationCount

      public int optimizationCount()
      Returns the value of the optimizationCount record component.
      Returns:
      the value of the optimizationCount record component
    • totalMessagesProcessed

      public int totalMessagesProcessed()
      Returns the value of the totalMessagesProcessed record component.
      Returns:
      the value of the totalMessagesProcessed record component
    • strategyName

      public String strategyName()
      Returns the value of the strategyName record component.
      Returns:
      the value of the strategyName record component