17 lines
502 B
TypeScript
17 lines
502 B
TypeScript
import type { ProcessedTrace } from "../components/TraceVisualization"
|
|
import type { TraceSummary } from "./types"
|
|
|
|
/** Same shape the server returns, derived from a fully loaded trace (for lists built from live data). */
|
|
export function summarizeTrace(t: ProcessedTrace): TraceSummary {
|
|
return {
|
|
id: t.id,
|
|
name: t.name,
|
|
startTime: t.startTime,
|
|
endTime: t.endTime,
|
|
duration: t.duration,
|
|
spanCount: t.spans.length,
|
|
errorCount: t.errorCount,
|
|
services: t.services,
|
|
}
|
|
}
|