Package com.tnsai.thread
Record Class ThreadUsage.Snapshot
java.lang.Object
java.lang.Record
com.tnsai.thread.ThreadUsage.Snapshot
- Enclosing class:
ThreadUsage
public static record ThreadUsage.Snapshot(long inputTokens, long outputTokens, int toolCalls, int messageCount, int checkpointCount, long elapsedMillis)
extends Record
Snapshot for serialization.
-
Constructor Summary
ConstructorsConstructorDescriptionSnapshot(long inputTokens, long outputTokens, int toolCalls, int messageCount, int checkpointCount, long elapsedMillis) Creates an instance of aSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecheckpointCountrecord component.longReturns the value of theelapsedMillisrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of theinputTokensrecord component.intReturns the value of themessageCountrecord component.longReturns the value of theoutputTokensrecord component.intReturns the value of thetoolCallsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Snapshot
public Snapshot(long inputTokens, long outputTokens, int toolCalls, int messageCount, int checkpointCount, long elapsedMillis) Creates an instance of aSnapshotrecord class.- Parameters:
inputTokens- the value for theinputTokensrecord componentoutputTokens- the value for theoutputTokensrecord componenttoolCalls- the value for thetoolCallsrecord componentmessageCount- the value for themessageCountrecord componentcheckpointCount- the value for thecheckpointCountrecord componentelapsedMillis- the value for theelapsedMillisrecord 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. All components in this record class are compared with '=='. -
inputTokens
public long inputTokens()Returns the value of theinputTokensrecord component.- Returns:
- the value of the
inputTokensrecord component
-
outputTokens
public long outputTokens()Returns the value of theoutputTokensrecord component.- Returns:
- the value of the
outputTokensrecord component
-
toolCalls
public int toolCalls()Returns the value of thetoolCallsrecord component.- Returns:
- the value of the
toolCallsrecord component
-
messageCount
public int messageCount()Returns the value of themessageCountrecord component.- Returns:
- the value of the
messageCountrecord component
-
checkpointCount
public int checkpointCount()Returns the value of thecheckpointCountrecord component.- Returns:
- the value of the
checkpointCountrecord component
-
elapsedMillis
public long elapsedMillis()Returns the value of theelapsedMillisrecord component.- Returns:
- the value of the
elapsedMillisrecord component
-