|
7 | 7 | * |
8 | 8 | * This script is strict: RUN_CONFIG_JSON must contain one of: |
9 | 9 | * - custom |
10 | | - * - realistic |
11 | 10 | * - scenario_definition |
12 | 11 | * If none are present, initialization fails. |
13 | 12 | * |
@@ -36,10 +35,8 @@ const DEFAULT_REQUEST_TIMEOUT = "120s"; |
36 | 35 | const DEFAULT_PROMPT_SEED = 1; |
37 | 36 | const DEFAULT_THINK_TIME = 2; |
38 | 37 | const DEFAULT_MAX_VUS = 10; |
39 | | -const DEFAULT_REALISTIC_USERS = 20; |
40 | 38 | const DEFAULT_RAMP_DOWN = "30s"; |
41 | 39 | const DEFAULT_DURATION = "5m"; |
42 | | -const DEFAULT_REALISTIC_DURATION = "15m"; |
43 | 40 | const ESTIMATED_CHARS_PER_TOKEN = 4; |
44 | 41 | const MS_PER_SECOND = 1000; |
45 | 42 | const LATENCY_LABEL_PATTERN = /^e2e_latency_ms\{label:(.+)\}$/; |
@@ -107,15 +104,18 @@ const IGNORE_EOS = |
107 | 104 | (RUN_CFG.ignore_eos ?? RUN_CFG.scenario_definition?.ignore_eos ?? false) === |
108 | 105 | true; |
109 | 106 | const PROMPT_SEED = parseInteger( |
110 | | - __ENV.PROMPT_SEED ?? RUN_CFG.prompt_seed ?? RUN_CFG.scenario_definition?.prompt_seed, |
| 107 | + __ENV.PROMPT_SEED ?? |
| 108 | + RUN_CFG.prompt_seed ?? |
| 109 | + RUN_CFG.scenario_definition?.prompt_seed, |
111 | 110 | DEFAULT_PROMPT_SEED, |
112 | 111 | ); |
113 | 112 | // THINK_TIME: max seconds of sleep between requests per VU (uniform [0, THINK_TIME]). |
114 | 113 | // Lower values → more in-flight requests → higher KV cache fill. 0 = no sleep. |
115 | 114 | const THINK_TIME = parseNumber(RUN_CFG.think_time, DEFAULT_THINK_TIME); |
116 | 115 | // MAX_TOKENS: when set, overrides the per-prompt max_tokens. |
117 | 116 | // KV cache fill is driven by the decode phase — longer outputs hold KV blocks longer. |
118 | | -// Use 1024–4096 with kv_stress to keep requests alive and fill the cache. |
| 117 | +// Use 1024–4096 in KV-heavy custom scenarios to keep requests alive and |
| 118 | +// fill the cache. |
119 | 119 | const MAX_TOKENS = RUN_CFG.max_tokens |
120 | 120 | ? Number.parseInt(RUN_CFG.max_tokens, 10) |
121 | 121 | : null; |
@@ -302,37 +302,21 @@ function buildCustomScenario(custom) { |
302 | 302 | }; |
303 | 303 | } |
304 | 304 |
|
305 | | -function buildRealisticScenario(realistic) { |
306 | | - if (!realistic) return null; |
307 | | - return { |
308 | | - executor: SCENARIO_CONSTANT_VUS, |
309 | | - vus: parsePositiveInteger(realistic.users, DEFAULT_REALISTIC_USERS), |
310 | | - duration: realistic.duration ?? DEFAULT_REALISTIC_DURATION, |
311 | | - }; |
312 | | -} |
313 | | - |
314 | 305 | const customScenario = RUN_CFG.custom |
315 | 306 | ? buildCustomScenario(RUN_CFG.custom) |
316 | 307 | : null; |
317 | | -const realisticScenario = RUN_CFG.realistic |
318 | | - ? buildRealisticScenario(RUN_CFG.realistic) |
319 | | - : null; |
320 | 308 | const definedScenario = scenarioToK6(RUN_CFG.scenario_definition); |
321 | | -const scenarioCandidates = [ |
322 | | - customScenario, |
323 | | - realisticScenario, |
324 | | - definedScenario, |
325 | | -].filter(Boolean); |
| 309 | +const scenarioCandidates = [customScenario, definedScenario].filter(Boolean); |
326 | 310 |
|
327 | 311 | if (scenarioCandidates.length === 0) { |
328 | 312 | throw new Error( |
329 | | - "No scenario found in RUN_CONFIG_JSON. Expected one of: custom, realistic, scenario_definition", |
| 313 | + "No scenario found in RUN_CONFIG_JSON. Expected one of: custom, scenario_definition", |
330 | 314 | ); |
331 | 315 | } |
332 | 316 |
|
333 | 317 | if (scenarioCandidates.length > 1) { |
334 | 318 | throw new Error( |
335 | | - "Ambiguous RUN_CONFIG_JSON: provide only one of custom, realistic, scenario_definition", |
| 319 | + "Ambiguous RUN_CONFIG_JSON: provide only one of custom, scenario_definition", |
336 | 320 | ); |
337 | 321 | } |
338 | 322 |
|
|
0 commit comments