MCPcopy Index your code
hub / github.com/simstudioai/sim / recordSimToolMetric

Function recordSimToolMetric

apps/sim/lib/copilot/request/metrics.ts:74–83  ·  view source on GitHub ↗
(name: string, outcome: string, durationMs: number)

Source from the content-addressed store, hash-verified

72// for one server-side Sim tool dispatch (executor=sim). outcome is the bounded
73// tool outcome (success/error/…). Pure telemetry.
74export function recordSimToolMetric(name: string, outcome: string, durationMs: number): void {
75 const { toolDuration, toolCalls } = instruments()
76 const attrs = {
77 [TraceAttr.ToolName]: cappedToolName(name),
78 [TraceAttr.ToolExecutor]: 'sim',
79 [TraceAttr.ToolOutcome]: outcome,
80 }
81 toolCalls.add(1, attrs)
82 if (durationMs >= 0) toolDuration.record(durationMs, attrs)
83}
84
85// recordVfsMaterialize records VFS materialization time. Call once per phase
86// with that phase's duration and once with phase="total" for the whole op, so

Callers 1

executeToolAndReportFunction · 0.90

Calls 3

instrumentsFunction · 0.85
cappedToolNameFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected