MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / timeSnapshot

Function timeSnapshot

packages/server/test/snapshot.perf.test.ts:59–64  ·  view source on GitHub ↗
(baseUrl: string, sid: string)

Source from the content-addressed store, hash-verified

57}
58
59async function timeSnapshot(baseUrl: string, sid: string): Promise<number> {
60 const t = performance.now();
61 const res = await fetch(`${baseUrl}/api/v1/sessions/${sid}/snapshot`, withAuth());
62 await res.text();
63 return performance.now() - t;
64}
65
66function quantile(samples: readonly number[], q: number): number {
67 const sorted = [...samples].sort((a, b) => a - b);

Callers 1

Calls 3

withAuthFunction · 0.90
nowMethod · 0.65
textMethod · 0.65

Tested by

no test coverage detected