perf: 300명 실시간 부하 측정 도구를 추가

This commit is contained in:
2026-08-16 18:05:55 +00:00
parent eb47de0e76
commit 54126cd67f
18 changed files with 1387 additions and 0 deletions
@@ -0,0 +1,103 @@
{
"$schema": "./load-test.schema.json",
"version": 1,
"name": "300-users-900-npcs-5m",
"target": {
"baseUrl": "http://127.0.0.1:15001",
"trpcPath": "/api/trpc",
"ssePath": "/events",
"publicProfile": false,
"allowedHosts": ["127.0.0.1", "localhost"]
},
"isolation": {
"postgresSchema": "load_capacity_300_900_5m",
"redisPrefix": "load-tests:capacity-300-900-5m:"
},
"capacity": {
"authenticatedViewers": 300,
"npcGenerals": 900,
"humanGenerals": 300,
"turnIntervalMs": 300000
},
"runtimeMetadata": {
"fixtureSha256": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
"imageDigest": "replace-before-measurement",
"postgresVersion": "replace-before-measurement",
"redisVersion": "replace-before-measurement"
},
"phases": [
{
"name": "idle-30m",
"kind": "idle",
"durationMs": 1800000,
"sseConnections": 300,
"requestIntervalMs": null,
"operations": []
},
{
"name": "own-context-5m",
"kind": "own",
"durationMs": 300000,
"sseConnections": 300,
"requestIntervalMs": 1000,
"operations": [
{
"name": "own-context",
"procedure": "dashboard.getContextBundleDelta",
"type": "query",
"weight": 1,
"input": {
"include": { "context": true, "commandTable": true, "boardAccess": true },
"forceSnapshot": false
}
}
]
},
{
"name": "global-slices-10m",
"kind": "global",
"durationMs": 600000,
"sseConnections": 300,
"requestIntervalMs": 5000,
"operations": [
{
"name": "global-records",
"procedure": "general.getRecentRecords",
"type": "query",
"weight": 1,
"input": { "lastGeneralRecordId": 0, "lastWorldHistoryId": 0 }
},
{ "name": "global-front", "procedure": "general.getFrontStatus", "type": "query", "weight": 1 },
{ "name": "global-lobby", "procedure": "lobby.info", "type": "query", "weight": 1 }
]
},
{
"name": "mixed-30m",
"kind": "mixed",
"durationMs": 1800000,
"sseConnections": 300,
"requestIntervalMs": 1000,
"operations": [
{
"name": "own-context",
"procedure": "dashboard.getContextBundleDelta",
"type": "query",
"weight": 5,
"input": {
"include": { "context": true, "commandTable": true, "boardAccess": true },
"forceSnapshot": false
}
},
{
"name": "global-records",
"procedure": "general.getRecentRecords",
"type": "query",
"weight": 1,
"input": { "lastGeneralRecordId": 0, "lastWorldHistoryId": 0 }
},
{ "name": "global-front", "procedure": "general.getFrontStatus", "type": "query", "weight": 1 },
{ "name": "global-lobby", "procedure": "lobby.info", "type": "query", "weight": 1 }
]
}
]
}
@@ -0,0 +1,96 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://sammo-ts.local/schemas/load-test.schema.json",
"title": "SAMMO authenticated API and SSE load configuration",
"type": "object",
"additionalProperties": false,
"required": ["version", "name", "target", "isolation", "capacity", "runtimeMetadata", "phases"],
"properties": {
"$schema": { "type": "string" },
"version": { "const": 1 },
"name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,63}$" },
"target": {
"type": "object",
"additionalProperties": false,
"required": ["baseUrl", "trpcPath", "ssePath", "publicProfile", "allowedHosts"],
"properties": {
"baseUrl": { "type": "string", "format": "uri", "pattern": "^https?://" },
"trpcPath": { "type": "string", "pattern": "^/" },
"ssePath": { "type": "string", "pattern": "^/" },
"publicProfile": { "const": false },
"allowedHosts": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 }
}
}
},
"isolation": {
"type": "object",
"additionalProperties": false,
"required": ["postgresSchema", "redisPrefix"],
"properties": {
"postgresSchema": { "type": "string", "pattern": "^load_[a-z0-9_]+$" },
"redisPrefix": { "type": "string", "pattern": "^load-tests:[a-z0-9:_-]+:$" }
}
},
"capacity": {
"type": "object",
"additionalProperties": false,
"required": ["authenticatedViewers", "npcGenerals", "humanGenerals", "turnIntervalMs"],
"properties": {
"authenticatedViewers": { "type": "integer", "minimum": 1 },
"npcGenerals": { "type": "integer", "minimum": 0 },
"humanGenerals": { "type": "integer", "minimum": 0 },
"turnIntervalMs": { "type": "integer", "minimum": 1000 }
}
},
"runtimeMetadata": {
"type": "object",
"additionalProperties": false,
"required": ["fixtureSha256", "imageDigest", "postgresVersion", "redisVersion"],
"properties": {
"fixtureSha256": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
"imageDigest": { "type": "string", "minLength": 1 },
"postgresVersion": { "type": "string", "minLength": 1 },
"redisVersion": { "type": "string", "minLength": 1 }
}
},
"phases": {
"type": "array",
"minItems": 4,
"items": { "$ref": "#/$defs/phase" }
}
},
"$defs": {
"phase": {
"type": "object",
"additionalProperties": false,
"required": ["name", "kind", "durationMs", "sseConnections", "requestIntervalMs", "operations"],
"properties": {
"name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,31}$" },
"kind": { "enum": ["idle", "own", "global", "mixed"] },
"durationMs": { "type": "integer", "minimum": 1000 },
"sseConnections": { "type": "integer", "minimum": 0 },
"requestIntervalMs": { "type": ["integer", "null"], "minimum": 50 },
"operations": {
"type": "array",
"items": { "$ref": "#/$defs/operation" }
}
}
},
"operation": {
"type": "object",
"additionalProperties": false,
"required": ["name", "procedure", "type", "weight"],
"properties": {
"name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,31}$" },
"procedure": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_.]+$" },
"type": { "const": "query" },
"weight": { "type": "integer", "minimum": 1, "maximum": 100 },
"input": {}
}
}
}
}