test(load): 1분 페이지 동시 부하 계측을 추가한다
국가 권한 사용자 10명과 800 NPC fixture를 만들고 Chromium 화면 순환, SSE, wall-clock 턴을 같은 시각에 측정한다.
This commit is contained in:
@@ -5,10 +5,22 @@ import path from 'node:path';
|
||||
import test from 'node:test';
|
||||
|
||||
import { validateLoadConfig } from '../src/config.js';
|
||||
import { activateCapacityCoverage, assertFixtureIsolation, prepareCapacitySecrets } from '../src/fixture.js';
|
||||
import {
|
||||
activateCapacityCoverage,
|
||||
assertFixtureIsolation,
|
||||
prepareCapacitySecrets,
|
||||
privilegedViewerPlacement,
|
||||
} from '../src/fixture.js';
|
||||
|
||||
const samplePath = new URL('../config/300-users-900-npcs-5m.json', import.meta.url);
|
||||
|
||||
void test('viewer placement stays in one nation and covers every privileged chief level deterministically', () => {
|
||||
assert.deepEqual(
|
||||
Array.from({ length: 10 }, (_, index) => privilegedViewerPlacement(index, 3, 7)),
|
||||
[12, 10, 8, 6, 11, 9, 7, 5, 12, 10].map((officerLevel) => ({ nationId: 3, cityId: 7, officerLevel }))
|
||||
);
|
||||
});
|
||||
|
||||
void test('fixture accepts only the configured private schema and dedicated Redis database', async () => {
|
||||
const config = validateLoadConfig(JSON.parse(await readFile(samplePath, 'utf8')));
|
||||
assert.doesNotThrow(() =>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { parseTrpcProcedures } from '../src/pageNavigation.js';
|
||||
|
||||
void test('tRPC page-load requests are attributed for single and batched procedures', () => {
|
||||
assert.deepEqual(
|
||||
parseTrpcProcedures('http://127.0.0.1:15001/api/trpc/auth.status?batch=1&input=%7B%7D', '/api/trpc'),
|
||||
['auth.status']
|
||||
);
|
||||
assert.deepEqual(
|
||||
parseTrpcProcedures(
|
||||
'http://127.0.0.1:15001/api/trpc/world.getMap%2Cworld.getMapLayout?batch=1',
|
||||
'/api/trpc'
|
||||
),
|
||||
['world.getMap', 'world.getMapLayout']
|
||||
);
|
||||
assert.deepEqual(parseTrpcProcedures('http://127.0.0.1:15001/healthz', '/api/trpc'), []);
|
||||
});
|
||||
Reference in New Issue
Block a user