MCPcopy Index your code
hub / github.com/docker/docker-agent / RecordTokenUsage

Method RecordTokenUsage

pkg/runtime/telemetry.go:30–30  ·  view source on GitHub ↗

RecordTokenUsage is fired after each model response that reports usage.

(ctx context.Context, model string, inputTokens, outputTokens int64, cost float64)

Source from the content-addressed store, hash-verified

28 RecordToolCall(ctx context.Context, toolName, sessionID, agentName string, duration time.Duration, err error)
29 // RecordTokenUsage is fired after each model response that reports usage.
30 RecordTokenUsage(ctx context.Context, model string, inputTokens, outputTokens int64, cost float64)
31}
32
33// defaultTelemetry forwards to the package-level helpers in pkg/telemetry.

Callers 5

TestNewClientFunction · 0.65
TestSessionTrackingFunction · 0.65
TestAllEventTypesFunction · 0.65
RecordTokenUsageFunction · 0.65
handleStreamFunction · 0.65

Implementers 3

Clientpkg/telemetry/types.go
recordingTelemetrypkg/runtime/telemetry_test.go
defaultTelemetrypkg/runtime/telemetry.go

Calls

no outgoing calls

Tested by 3

TestNewClientFunction · 0.52
TestSessionTrackingFunction · 0.52
TestAllEventTypesFunction · 0.52