Skip to content

Performance and Observability Budgets

Production-grade agent workflows need predictable runtime behavior. EasyEDA MCP Pro exposes latency budgets, in-memory metrics, vendor timing, cache counters, and retention expectations through a diagnostics tool.

Tool

text
easyeda_observability_report

The tool is read-only and returns:

  • latency budgets by category;
  • runtime metrics snapshot;
  • cache hit/miss/write/delete counters;
  • vendor API timing summary;
  • storage and artifact retention policy;
  • default bridge timeout policy.

Latency budgets

CategoryP50P95TimeoutScope
diagnostics50 ms250 ms1 sLocal diagnostics and metadata-only tools
bridge-read250 ms1.5 s15 sRead-only EasyEDA bridge calls
bridge-write500 ms3 s30 sConfirmed bridge write/apply calls
vendor-api800 ms5 s30 sExternal vendor API requests including retry overhead
cache10 ms50 ms250 msSQLite cache and metadata lookups
export1 s10 s60 sManufacturing/export generation workflows
analysis100 ms1 s5 sLocal DRC/ERC, BOM, power-tree, PCB and QA analysis
documentation50 ms500 ms2 sGenerated docs, summaries and manifests

Budget evaluation uses three states:

text
ok   -> duration <= p95 budget
warn -> duration > p95 budget but <= timeout budget
fail -> duration > timeout budget

Runtime metrics

The in-memory metrics collector records:

typescript
{
  toolCalls: number;
  bridgeCalls: number;
  budgetWarnings: number;
  budgetFailures: number;
  byCategory: Record<
    string,
    {
      count: number;
      ok: number;
      errors: number;
      averageDurationMs: number;
      maxDurationMs: number;
    }
  >;
  cache: {
    hits: number;
    misses: number;
    writes: number;
    deletes: number;
    hitRate: number;
  }
  vendors: Record<
    string,
    {
      requestCount: number;
      errorCount: number;
      averageDurationMs: number;
      lastStatusCode?: number;
    }
  >;
}

The snapshot is intentionally memory-only. It is useful for local diagnostics, Inspector sessions, CI smoke checks, and support reports. It must not include secrets or raw vendor credentials.

Timeout behavior

Bridge calls use the configured bridge timeout unless a tool supplies a narrower timeout. Long-running live diagnostics and raw API execution accept explicit timeoutMs inputs with schema bounds.

Timeouts are surfaced as structured failures and recorded as failed budget events. The bridge manager also has a stale request sweep as a defensive cleanup path.

Cache and artifact retention

Default retention policy:

FieldDefault
cache default TTL24 h
vendor cache TTL7 d
artifact retention30 d
telemetry retention14 d
cleanup cadencemanual
max artifact bytes512 MiB

Cache entries with explicit TTL expire automatically on read. Artifact cleanup is conservative and should be invoked explicitly before deleting handoff files.

Regression guard

Representative unit tests cover:

  • budget status evaluation;
  • diagnostics output schema;
  • registry-level tool duration instrumentation;
  • cache hit/miss/write/delete counters;
  • vendor request timing on success/failure;
  • bounded retention defaults.

These tests prevent accidental removal of observability fields or unbounded retention defaults.

Released under the MIT License.