AS AgentScopeAPI 手册 / API Reference

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
keyString
执行键相关操作。
Performs the key operation.
callslong
执行调用相关操作。
Performs the calls operation.
inputTokenslong
执行输入令牌数相关操作。
Performs the input tokens operation.
outputTokenslong
执行输出令牌数相关操作。
Performs the output tokens operation.
totalTokenslong
执行总数令牌数相关操作。
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–30

calls

long calls

执行调用相关操作。

Performs the calls operation.

源码Source io/agentscope/spring/boot/admin/metrics/UsageStats.java:24–30

inputTokens

long inputTokens

执行输入令牌数相关操作。

Performs the input tokens operation.

源码Source io/agentscope/spring/boot/admin/metrics/UsageStats.java:24–30

outputTokens

long outputTokens

执行输出令牌数相关操作。

Performs the output tokens operation.

源码Source io/agentscope/spring/boot/admin/metrics/UsageStats.java:24–30

totalTokens

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
keyString键(类型 `String`)。The key.
返回Returns UsageStats
返回UsageStats。Returns usage stats.
源码Source io/agentscope/spring/boot/admin/metrics/UsageStats.java:27–29
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.