feat: 다중 프로필 DB 부하 계측을 추가
production 턴 런타임의 lease, flush, outbox와 Redis 발행을 한 달 단위로 측정한다. nya와 pya 1분 프로필의 격리 fixture 및 현재 process·잠금 경계 문서를 함께 추가한다.
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
verifyCapacityFixture,
|
||||
} from './fixture.js';
|
||||
import { describeDryRun, runLoadTest } from './runner.js';
|
||||
import { measureTurnFlush } from './turnFlush.js';
|
||||
|
||||
type Command =
|
||||
| 'run'
|
||||
@@ -20,12 +21,13 @@ type Command =
|
||||
| 'seed'
|
||||
| 'verify-fixture'
|
||||
| 'activate-coverage'
|
||||
| 'measure-turn-flush'
|
||||
| 'materialize-calibration'
|
||||
| 'cleanup';
|
||||
|
||||
const usage = (): never => {
|
||||
process.stderr.write(
|
||||
'usage: cli.ts <validate|dry-run|run|prepare|seed|verify-fixture|activate-coverage|materialize-calibration|cleanup> --config <file> [--tokens <0600-gitignored-file>] [--output <new-json-file>] [--confirm <load_schema>]\n'
|
||||
'usage: cli.ts <validate|dry-run|run|prepare|seed|verify-fixture|activate-coverage|measure-turn-flush|materialize-calibration|cleanup> --config <file> [--tokens <0600-gitignored-file>] [--output <new-json-file>] [--confirm <load_schema>]\n'
|
||||
);
|
||||
process.exit(64);
|
||||
};
|
||||
@@ -43,6 +45,7 @@ const parseArguments = (
|
||||
'seed',
|
||||
'verify-fixture',
|
||||
'activate-coverage',
|
||||
'measure-turn-flush',
|
||||
'materialize-calibration',
|
||||
'cleanup',
|
||||
].includes(command ?? '')
|
||||
@@ -69,6 +72,11 @@ const parseArguments = (
|
||||
(!values.get('--confirm') || values.has('--tokens') || values.has('--output'))
|
||||
)
|
||||
usage();
|
||||
if (
|
||||
command === 'measure-turn-flush' &&
|
||||
(!values.get('--confirm') || !values.get('--output') || values.has('--tokens'))
|
||||
)
|
||||
usage();
|
||||
if (
|
||||
command === 'materialize-calibration' &&
|
||||
(!values.get('--output') || values.has('--tokens') || values.has('--confirm'))
|
||||
@@ -116,6 +124,20 @@ const main = async (): Promise<void> => {
|
||||
process.stdout.write(`${JSON.stringify(await activateCapacityCoverage(config, args.confirm!))}\n`);
|
||||
return;
|
||||
}
|
||||
if (args.command === 'measure-turn-flush') {
|
||||
const output = path.resolve(args.output!);
|
||||
await mkdir(path.dirname(output), { recursive: true });
|
||||
const result = await measureTurnFlush({ config, confirmation: args.confirm! });
|
||||
await writeFile(output, `${JSON.stringify(result, null, 2)}\n`, {
|
||||
encoding: 'utf8',
|
||||
flag: 'wx',
|
||||
mode: 0o600,
|
||||
});
|
||||
process.stdout.write(
|
||||
`${JSON.stringify({ completed: true, processedGenerals: result.throughput.processedGenerals, outputWritten: true })}\n`
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (args.command === 'materialize-calibration') {
|
||||
process.stdout.write(
|
||||
`${JSON.stringify(
|
||||
|
||||
Reference in New Issue
Block a user