MCPcopy
hub / github.com/CodebuffAI/codebuff / getRecentTraces

Function getRecentTraces

packages/bigquery/src/client.ts:274–290  ·  view source on GitHub ↗
(
  limit: number = 10,
  dataset: string = DATASET,
)

Source from the content-addressed store, hash-verified

272}
273
274export async function getRecentTraces(
275 limit: number = 10,
276 dataset: string = DATASET,
277) {
278 const query = `
279 SELECT * FROM ${dataset}.${TRACES_TABLE}
280 ORDER BY created_at DESC
281 LIMIT ${limit}
282 `
283 const [rows] = await getClient().query(query)
284 // Parse the payload as JSON if it's a string
285 return rows.map((row) => ({
286 ...row,
287 payload:
288 typeof row.payload === 'string' ? JSON.parse(row.payload) : row.payload,
289 })) as Trace[]
290}
291
292export async function getRecentRelabels(
293 limit: number = 10,

Callers 1

printRecentTracesFunction · 0.90

Calls 2

getClientFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected