AgentscopeUsageEndpoint
@Endpoint(id = "agentscope-usage") public class AgentscopeUsageEndpoint
源码Source
io/agentscope/spring/boot/admin/endpoint/AgentscopeUsageEndpoint.java:33–58Agentscope 用量端点,承载智能体的部署、调度与服务化运行。位于 io.agentscope.spring.boot.admin.endpoint 包。核心成员包括 usage、forAgent、AgentscopeUsageEndpoint。
GET /actuator/agentscope-usage: process-cumulative token usage, sliced both by agent
name and by model name.
Counters reset on JVM restart (in-process only). For long-horizon billing, forward the
derived io.agentscope.spring.boot.admin.audit.AdminAuditEvents into your data
warehouse instead of relying on this endpoint.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public AgentscopeUsageEndpoint(MetricsRecorder recorder) | 初始化 `AgentscopeUsageEndpoint` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Map<String, Object> usage() | 返回用量。 Returns the usage. |
public UsageStats forAgent(String agentName) | 设置用于智能体。 Convenience for callers asking only about a single agent. |
构造器详情Constructor Detail
AgentscopeUsageEndpoint
public AgentscopeUsageEndpoint(MetricsRecorder recorder)
初始化 AgentscopeUsageEndpoint 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
recorder | MetricsRecorder | 记录器(类型 `MetricsRecorder`)。The recorder. |
源码Source
io/agentscope/spring/boot/admin/endpoint/AgentscopeUsageEndpoint.java:38–40方法详情Method Detail
usage
public Map<String, Object> usage()
返回用量。
Returns the usage.
Map<String, Object>返回映射。Returns map.
源码Source
io/agentscope/spring/boot/admin/endpoint/AgentscopeUsageEndpoint.java:42–49forAgent
public UsageStats forAgent(String agentName)
设置用于智能体。
Convenience for callers asking only about a single agent.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentName | String | 智能体名称(类型 `String`)。The agent name. |
UsageStats返回UsageStats。Returns usage stats.
源码Source
io/agentscope/spring/boot/admin/endpoint/AgentscopeUsageEndpoint.java:52–57