MCPcopy Create free account
hub / github.com/arctic-cli/interface / track

Function track

packages/arctic/src/telemetry/index.ts:71–89  ·  view source on GitHub ↗
(event: string, properties?: Record<string, string | number | boolean>)

Source from the content-addressed store, hash-verified

69 }
70
71 export async function track(event: string, properties?: Record<string, string | number | boolean>): Promise<void> {
72 if (!(await isEnabled())) return
73
74 queue.push({
75 event,
76 properties,
77 timestamp: Date.now(),
78 })
79
80 log.debug("tracked", { event, properties })
81
82 if (queue.length >= MAX_QUEUE_SIZE) {
83 flush().catch(() => {})
84 }
85
86 if (!flushTimer) {
87 flushTimer = setInterval(() => flush().catch(() => {}), FLUSH_INTERVAL)
88 }
89 }
90
91 export async function flush(): Promise<void> {
92 if (queue.length === 0) return

Callers 11

dailyHeartbeatFunction · 0.70
appStartedFunction · 0.70
sessionStartedFunction · 0.70
sessionEndedFunction · 0.70
messageSentFunction · 0.70
toolInvokedFunction · 0.70
commandUsedFunction · 0.70
providerAuthedFunction · 0.70
agentSpawnedFunction · 0.70
mcpConnectedFunction · 0.70
errorOccurredFunction · 0.70

Calls 3

pushMethod · 0.80
isEnabledFunction · 0.70
flushFunction · 0.70

Tested by

no test coverage detected