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

Function addToBatch

apps/sim/instrumentation-client.ts:34–44  ·  view source on GitHub ↗

* Add event to batch and schedule flush

(event: any)

Source from the content-addressed store, hash-verified

32 * Add event to batch and schedule flush
33 */
34 function addToBatch(event: any): void {
35 if (!telemetryEnabled) return
36
37 eventBatch.push(event)
38
39 if (eventBatch.length >= MAX_BATCH_SIZE) {
40 flushBatch()
41 } else if (!batchTimer) {
42 batchTimer = setTimeout(flushBatch, BATCH_INTERVAL_MS)
43 }
44 }
45
46 /**
47 * Flush batch of events to server

Callers 1

Calls 2

flushBatchFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected