MCPcopy Create free account
hub / github.com/ShipSecAI/studio / countByType

Method countByType

backend/src/trace/trace.repository.ts:134–146  ·  view source on GitHub ↗
(
    runId: string,
    type: TraceEventType,
    organizationId?: string | null,
  )

Source from the content-addressed store, hash-verified

132 }
133
134 async countByType(
135 runId: string,
136 type: TraceEventType,
137 organizationId?: string | null,
138 ): Promise<number> {
139 const runFilter = this.buildRunFilter(runId, organizationId);
140 const [result] = await this.db
141 .select({ value: sql<number>`count(*)` })
142 .from(workflowTracesTable)
143 .where(and(runFilter, eq(workflowTracesTable.type, type)));
144
145 return Number(result?.value ?? 0);
146 }
147
148 /**
149 * Get the first and last event timestamps for a run to calculate accurate duration

Callers 2

buildRunSummaryMethod · 0.80
getRunStatusMethod · 0.80

Calls 2

buildRunFilterMethod · 0.95
fromMethod · 0.80

Tested by

no test coverage detected