AgentSkillsCN

metrics

查看系统性能指标与遥测数据。在检查堆内存统计、路由性能、系统健康状况,或排查性能问题时使用。

SKILL.md
--- frontmatter
name: metrics
description: View system performance metrics and telemetry. Use when checking heap statistics, route performance, system health, or debugging performance issues.

Metrics

View system performance metrics and telemetry.

Usage

text
/metrics           - Show current performance metrics
/metrics heap      - Heap statistics (memory usage)
/metrics routes    - Route performance breakdown
/metrics health    - System health status
/metrics report    - Full performance report

HTTP Endpoints

EndpointDescription
GET /mcp/metricsRegistry performance metrics
GET /mcp/healthHealth check with status

Examples

bash
# Get registry metrics
curl http://localhost:3333/mcp/metrics

# Health check
curl http://localhost:3333/mcp/health

Performance Targets (SLA)

MetricTargetDescription
P99 Latency10.8ms99th percentile request
Dispatch<0.03msURLPattern match + params
Route Test<0.01msURLPattern.test() only
Heap Reduction-14%vs Node.js baseline
Cold Start~0msServer initialization

Health Status Levels

StatusHeap PressureDispatch Time
EXCELLENT<30%<0.05us
GOOD30-50%0.05-0.5us
ACCEPTABLE50-70%0.5-5us
DEGRADED70-90%5-10us
CRITICAL>90%>10us

Telemetry Functions

typescript
import { getPerformanceTelemetry, getPerformanceHealth } from './core/performance';

const telemetry = getPerformanceTelemetry();
console.log(`Health: ${getPerformanceHealth()}`);
console.log(`Heap: ${telemetry.heapPressure.toFixed(2)}%`);

Heap Analysis

typescript
import { heapStats } from 'bun:jsc';

const stats = heapStats();
console.log(`Heap Size: ${stats.heapSize}`);
console.log(`Object Count: ${stats.objectCount}`);

Related Skills

  • /bench - Run performance benchmarks
  • /exchange - Exchange-specific metrics