mirror of
https://github.com/garrytan/gstack.git
synced 2026-07-18 21:47:20 +02:00
fix(test-harness): measure first response on first NDJSON line
This commit is contained in:
@@ -233,6 +233,11 @@ export async function runSkillTest(options: {
|
|||||||
if (!line.trim()) continue;
|
if (!line.trim()) continue;
|
||||||
collectedLines.push(line);
|
collectedLines.push(line);
|
||||||
|
|
||||||
|
// Track time to first NDJSON line (measures latency from spawn to first Claude response)
|
||||||
|
if (firstResponseMs === 0) {
|
||||||
|
firstResponseMs = Date.now() - startTime;
|
||||||
|
}
|
||||||
|
|
||||||
// Real-time progress to stderr + persistent logs
|
// Real-time progress to stderr + persistent logs
|
||||||
try {
|
try {
|
||||||
const event = JSON.parse(line);
|
const event = JSON.parse(line);
|
||||||
@@ -244,8 +249,7 @@ export async function runSkillTest(options: {
|
|||||||
liveToolCount++;
|
liveToolCount++;
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const elapsed = Math.round((now - startTime) / 1000);
|
const elapsed = Math.round((now - startTime) / 1000);
|
||||||
// Track timing telemetry
|
// Track inter-turn latency (tool call to tool call)
|
||||||
if (firstResponseMs === 0) firstResponseMs = now - startTime;
|
|
||||||
if (lastToolTime > 0) {
|
if (lastToolTime > 0) {
|
||||||
const interTurn = now - lastToolTime;
|
const interTurn = now - lastToolTime;
|
||||||
if (interTurn > maxInterTurnMs) maxInterTurnMs = interTurn;
|
if (interTurn > maxInterTurnMs) maxInterTurnMs = interTurn;
|
||||||
|
|||||||
Reference in New Issue
Block a user