Make throughput goal 6, with floors a release has to clear
Test / lint (pull_request) Successful in 21s
Test / test (18) (pull_request) Successful in 30s
Test / test (20) (pull_request) Successful in 29s
Test / test (22) (pull_request) Successful in 30s
Test / test (24) (pull_request) Successful in 30s
Test / test (26) (pull_request) Successful in 31s
Mirror / push (push) Successful in 5s
Test / lint (pull_request) Successful in 21s
Test / test (18) (pull_request) Successful in 30s
Test / test (20) (pull_request) Successful in 29s
Test / test (22) (pull_request) Successful in 30s
Test / test (24) (pull_request) Successful in 30s
Test / test (26) (pull_request) Successful in 31s
Mirror / push (push) Successful in 5s
This commit was merged in pull request #14.
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import { availableParallelism } from 'node:os';
|
||||
import { spawn } from 'node:child_process';
|
||||
import { once } from 'node:events';
|
||||
import { createInterface } from 'node:readline';
|
||||
|
||||
/** Goal 6's floors, per send window. Set GATE=1 to fail the run instead of only reporting. */
|
||||
const floors: Record<number, number> = { 1: 5000, 10: 20_000, 50: 30_000, 200: 30_000 };
|
||||
|
||||
/** Below this, client and sink contend for one core and the windowed floors are unreachable. */
|
||||
const gateCores = 4;
|
||||
|
||||
/**
|
||||
* Node rather than Python, unlike the repo's other standalone scripts: it spawns the two processes
|
||||
* it measures, and they must run on the same runtime this library is measured under.
|
||||
@@ -61,3 +68,28 @@ for (const row of rows) {
|
||||
|
||||
process.stdout.write(`${dlr}${window}${rate}${String(row.seconds)}\n`);
|
||||
}
|
||||
|
||||
const cores = availableParallelism();
|
||||
|
||||
process.stdout.write(`\n${String(cores)} cores\n`);
|
||||
|
||||
if (process.env.GATE !== '1') process.exit(0);
|
||||
|
||||
if (cores < gateCores) {
|
||||
process.stdout.write(`refusing to gate on ${String(cores)} cores; goal 6 states four or more\n`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const short = rows.filter(row => {
|
||||
const floor = floors[Number(row.concurrency)];
|
||||
|
||||
return floor !== undefined && Number(row.perSecond) < floor;
|
||||
});
|
||||
|
||||
for (const row of short) {
|
||||
const floor = String(floors[Number(row.concurrency)]);
|
||||
|
||||
process.stdout.write(`below goal 6: window ${String(row.concurrency)} ran ${String(row.perSecond)}/s, floor is ${floor}\n`);
|
||||
}
|
||||
|
||||
process.exit(short.length === 0 ? 0 : 1);
|
||||
|
||||
Reference in New Issue
Block a user