diff --git a/benchmarks/main.ts b/benchmarks/main.ts index 2f3a106ab4..8589ab028d 100644 --- a/benchmarks/main.ts +++ b/benchmarks/main.ts @@ -239,8 +239,10 @@ await new Command() clearInterval(updateState); - await Deno.stdout.write(enc(" ".padStart(30) + `\rduration: ${seconds} | jobs sent: ${JSON.stringify(jobsSent)}\n`)); + const sum = jobsSent.reduce((a, b) => a + b, 0) + await Deno.stdout.write(enc(" ".padStart(30) + `\rduration: ${seconds} | jobs sent: ${sum}\n`)); + const shutdown_start = Date.now(); let zombie_jobs = 0; let incorrect_results = 0; workers.forEach((worker) => { @@ -263,6 +265,9 @@ await new Command() while (workers.length > 0) { await sleep(0.1); } + const tts = (Date.now() - shutdown_start) / 1000; + console.log("time to shutdown:", tts); + console.log("throughput /s", sum / (seconds + tts)); console.log("zombie jobs: ", zombie_jobs); console.log("incorrect results: ", incorrect_results); diff --git a/benchmarks/worker.ts b/benchmarks/worker.ts index ee296b4f31..34df7ede95 100644 --- a/benchmarks/worker.ts +++ b/benchmarks/worker.ts @@ -104,6 +104,8 @@ clearInterval(updateStatusInterval); const end_time = Date.now() + complete_timeout; let incorrect_results = 0; +const enc = (s: string) => new TextEncoder().encode(s); + while (outstanding.length > 0 && Date.now() < end_time) { const uuid = outstanding.shift()!; @@ -116,7 +118,8 @@ while (outstanding.length > 0 && Date.now() < end_time) { } if (r.type == 'QueuedJob') { outstanding.push(uuid); - console.log(uuid, (await windmill.JobService.listQueue({ workspace: config.workspace_id })).length) + await Deno.stdout.write(enc(`uuid: ${uuid}, queue length: ${(await windmill.JobService.listQueue({ workspace: config.workspace_id })).length} \r`)); + } else if (!config.useFlows) { r = r as api.CompletedJob; try {