UsageStats
public record UsageStats( String key, long calls, long inputTokens, long outputTokens, long totalTokens)
源码Source
io/agentscope/spring/boot/admin/metrics/UsageStats.java:24–30承载用量 Stats数据的记录类型。位于 io.agentscope.spring.boot.admin.metrics 包。核心成员包括 key、calls、inputTokens、outputTokens、totalTokens、zero。
Immutable snapshot of accumulated usage counters for a single bucket (agent or model).
totalTokens mirrors io.agentscope.core.model.ChatUsage#getTotalTokens() —
inputTokens + outputTokens when both are reported; some providers report only the sum.
记录组件摘要Record Component Summary
| 组件Component | 类型Type | 说明Description |
|---|---|---|
key | String | 执行键相关操作。 Performs the key operation. |
calls | long | 执行调用相关操作。 Performs the calls operation. |
inputTokens | long | 执行输入令牌数相关操作。 Performs the input tokens operation. |
outputTokens | long | 执行输出令牌数相关操作。 Performs the output tokens operation. |
totalTokens | long | 执行总数令牌数相关操作。 Performs the total tokens operation. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static UsageStats zero(String key)static | 设置该参数。 Performs the zero operation. |
记录组件详情Record Component Detail
key
String key执行键相关操作。
Performs the key operation.
源码Source
io/agentscope/spring/boot/admin/metrics/UsageStats.java:24–30calls
long calls执行调用相关操作。
Performs the calls operation.
源码Source
io/agentscope/spring/boot/admin/metrics/UsageStats.java:24–30inputTokens
long inputTokens执行输入令牌数相关操作。
Performs the input tokens operation.
源码Source
io/agentscope/spring/boot/admin/metrics/UsageStats.java:24–30outputTokens
long outputTokens执行输出令牌数相关操作。
Performs the output tokens operation.
源码Source
io/agentscope/spring/boot/admin/metrics/UsageStats.java:24–30totalTokens
long totalTokens执行总数令牌数相关操作。
Performs the total tokens operation.
源码Source
io/agentscope/spring/boot/admin/metrics/UsageStats.java:24–30方法详情Method Detail
zero
public static UsageStats zero(String key)
static
设置该参数。
Performs the zero operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 键(类型 `String`)。The key. |
UsageStats返回UsageStats。Returns usage stats.
源码Source
io/agentscope/spring/boot/admin/metrics/UsageStats.java:27–29