MCPcopy Create free account
hub / github.com/anomalyco/opencode / countRoutedEvents

Function countRoutedEvents

packages/stats/server/src/ingest.ts:130–139  ·  view source on GitHub ↗
(events: unknown[])

Source from the content-addressed store, hash-verified

128})
129
130function countRoutedEvents(events: unknown[]) {
131 let records = 0
132 let unsupported = 0
133 for (const event of events) {
134 if (!isRecord(event)) continue
135 if (routeEvent(event)) records++
136 else unsupported++
137 }
138 return { records, unsupported }
139}
140
141function isRecord(item: unknown): item is IngestEvent {
142 return Boolean(item) && typeof item === "object" && !Array.isArray(item)

Callers 1

IngestClass · 0.85

Calls 2

routeEventFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected