AS AgentScopeAPI 手册 / API Reference

CodingAgentMetrics

public class CodingAgentMetrics
源码Source io/agentscope/harness/coding/observability/CodingAgentMetrics.java:41–118

Coding 智能体指标,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.coding.observability 包。核心成员包括 recordWebhookReceived、recordWebhookDuplicate、recordDispatch、recordDispatchError、recordModelCall、recordFindingAdded。

Centralized Micrometer metrics for the coding agent.

Metrics are exposed via Spring Boot Actuator (/actuator/prometheus) and can be scraped by Prometheus or shipped to an OTel collector via the Micrometer OTel bridge.

Key metrics:

  • coding_agent.webhook.received — total GitHub webhooks received (tagged by event)

  • coding_agent.webhook.duplicate — deduplicated webhook deliveries

  • coding_agent.dispatch.total — total agent dispatches (tagged by agent_id)

  • coding_agent.dispatch.errors — failed dispatches

  • coding_agent.model.calls — LLM calls across all threads

  • coding_agent.findings.added — reviewer findings added

  • coding_agent.review.published — PR reviews published to GitHub

  • coding_agent.dispatch.duration — end-to-end dispatch latency

构造器摘要Constructor Summary

构造器Constructor说明Description
public CodingAgentMetrics(MeterRegistry registry)
初始化 `CodingAgentMetrics` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public void recordWebhookReceived()
执行 `recordWebhookReceived` 方法。
Returns the record webhook received.
public void recordWebhookDuplicate()
执行 `recordWebhookDuplicate` 方法。
Returns the record webhook duplicate.
public void recordDispatch()
执行 `recordDispatch` 方法。
Returns the record dispatch.
public void recordDispatchError()
执行 `recordDispatchError` 方法。
Returns the record dispatch error.
public void recordModelCall()
执行 `recordModelCall` 方法。
Returns the record model call.
public void recordFindingAdded()
执行 `recordFindingAdded` 方法。
Returns the record finding added.
public void recordReviewPublished()
执行 `recordReviewPublished` 方法。
Returns the record review published.
public Timer getDispatchDuration()
获取 `getDispatchDuration`。
Returns the dispatch duration.

构造器详情Constructor Detail

CodingAgentMetrics

public CodingAgentMetrics(MeterRegistry registry)

初始化 CodingAgentMetrics 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
registryMeterRegistry注册表(类型 `MeterRegistry`)。The registry.
源码Source io/agentscope/harness/coding/observability/CodingAgentMetrics.java:52–85

方法详情Method Detail

recordWebhookReceived

public void recordWebhookReceived()

执行 recordWebhookReceived 方法。

Returns the record webhook received.

源码Source io/agentscope/harness/coding/observability/CodingAgentMetrics.java:87–89

recordWebhookDuplicate

public void recordWebhookDuplicate()

执行 recordWebhookDuplicate 方法。

Returns the record webhook duplicate.

源码Source io/agentscope/harness/coding/observability/CodingAgentMetrics.java:91–93

recordDispatch

public void recordDispatch()

执行 recordDispatch 方法。

Returns the record dispatch.

源码Source io/agentscope/harness/coding/observability/CodingAgentMetrics.java:95–97

recordDispatchError

public void recordDispatchError()

执行 recordDispatchError 方法。

Returns the record dispatch error.

源码Source io/agentscope/harness/coding/observability/CodingAgentMetrics.java:99–101

recordModelCall

public void recordModelCall()

执行 recordModelCall 方法。

Returns the record model call.

源码Source io/agentscope/harness/coding/observability/CodingAgentMetrics.java:103–105

recordFindingAdded

public void recordFindingAdded()

执行 recordFindingAdded 方法。

Returns the record finding added.

源码Source io/agentscope/harness/coding/observability/CodingAgentMetrics.java:107–109

recordReviewPublished

public void recordReviewPublished()

执行 recordReviewPublished 方法。

Returns the record review published.

源码Source io/agentscope/harness/coding/observability/CodingAgentMetrics.java:111–113

getDispatchDuration

public Timer getDispatchDuration()

获取 getDispatchDuration。

Returns the dispatch duration.

返回Returns Timer
返回Timer。Returns timer.
源码Source io/agentscope/harness/coding/observability/CodingAgentMetrics.java:115–117
基于官方固定版本源码静态生成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.