← 返回
数据分析 中文

Agent Metrics

Monitor AI agent calls, errors, latency, and resource usage with a terminal dashboard and JSON export for observability and metrics tracking.
使用终端仪表盘和JSON导出监控AI代理的调用、错误、延迟和资源使用,实现可观测性与指标跟踪。
nantes
数据分析 clawhub v1.0.5 1 版本 99842.9 Key: 无需
★ 0
Stars
📥 1,271
下载
💾 20
安装
1
版本
#agent#latest#metrics#utility

概述

Agent Metrics Skill

Track and monitor your AI agent's behavior with built-in observability.

Files included:

  • metrics.py - Python CLI (cross-platform)
  • agent-metrics.ps1 - PowerShell wrapper (Windows)

What it does

  • Call Tracking - Count API calls, messages, tasks
  • Error Logging - Track errors with stack traces
  • Latency Metrics - Measure response times
  • Resource Usage - CPU, memory, network
  • Simple Dashboard - Terminal-based metrics view
  • Export - JSON export for external dashboards

Installation

# Install Python dependency
pip install psutil

Usage

Option 1: PowerShell (recommended on Windows)

.\agent-metrics.ps1 -Action record -MetricType call -Label "api_openai"

Option 2: Python CLI (cross-platform)

python metrics.py record --type call --label "api_openai"

Record an Error

.\agent-metrics.ps1 -Action record -MetricType error -Label "api_error" -Details "Rate limit exceeded"

Record Latency

.\agent-metrics.ps1 -Action record -MetricType latency -Label "task_process" -Value 1500

View Dashboard

.\agent-metrics.ps1 -Action dashboard

View Resource Usage (CPU, Memory, Disk)

.\agent-metrics.ps1 -Action resources

Export Metrics

.\agent-metrics.ps1 -Action export -Format json -Output metrics.json

Get Summary

.\agent-metrics.ps1 -Action summary

Metrics Types

TypeDescriptionFields
---------------------------
callAPI call madelabel, timestamp
errorError occurredlabel, details, timestamp
latencyResponse time (ms)label, value, timestamp
customCustom metriclabel, value

Dashboard Example

╔═══════════════════════════════════════════════╗
║           AGENT METRICS DASHBOARD            ║
╠═══════════════════════════════════════════════╣
║ Total Calls:     1,247                       ║
║ Total Errors:   23                          ║
║ Error Rate:     1.84%                        ║
║ Avg Latency:    234ms                        ║
║ Uptime:         4h 32m                      ║
╠═══════════════════════════════════════════════╣
║ Top Labels:                                  ║
║   api_openai      892 (71.5%)               ║
║   api_claude      234 (18.8%)               ║
║   task_process    121 (9.7%)                ║
╚═══════════════════════════════════════════════╝

Requirements

  • Python 3.8+
  • psutil library

License

MIT

版本历史

共 1 个版本

  • v1.0.5 当前
    2026-03-29 05:58 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Mcp Client

nantes
模型上下文协议(MCP)客户端 - 连接工具、数据源和服务
★ 1 📥 2,828
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 65,124
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,470