This commit is contained in:
Ruben Fiszel
2022-10-19 03:41:51 +02:00
parent f4ff43ec49
commit bea934489c
2 changed files with 10 additions and 2 deletions
+6 -1
View File
@@ -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);
+4 -1
View File
@@ -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 {