43f69f4888eda506838d7bed0426a1d57a14868d

Author
TheEdgeOfRage <git@theedgeofrage.com>
Committer
TheEdgeOfRage <git@theedgeofrage.com>
Date

Message

Print per-response timing on llm tests

Diff

 1diff --git a/test/core/llm.test.ts b/test/core/llm.test.ts
 2index 2232e168e34ab222a4b055bcf06521c757f35c75..8954df667c1399f2822ecd8f69ad528650f0ac65 100644
 3--- a/test/core/llm.test.ts
 4+++ b/test/core/llm.test.ts
 5@@ -152,10 +152,15 @@ EOF
 6 async function assertDecision(command: string, expected: ExpectedDecision) {
 7   const results: LLMEvaluationResult[] = []
 8   for (let run = 0; run < RUNS; run++) {
 9-    results.push(await reviewer!.evaluate(
10-      { toolName: "bash", input: { command } },
11-      {},
12-    ))
13+    const startedAt = performance.now()
14+    try {
15+      results.push(await reviewer!.evaluate(
16+        { toolName: "bash", input: { command } },
17+        {},
18+      ))
19+    } finally {
20+      console.log(`request ${run + 1}/${RUNS}: duration=${(performance.now() - startedAt).toFixed(0)}ms`)
21+    }
22   }
23 
24   const decisions: Decision[] = results.map(({ decision }) => decision)