viberadar 0.3.211 → 0.3.212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/index.js +9 -7
- package/dist/server/index.js.map +1 -1
- package/dist/ui/dashboard.html +22 -143
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -2278,10 +2278,12 @@ function startServer({ data: initialData, port, projectRoot }) {
|
|
|
2278
2278
|
const executionMode = cfg.executionMode === 'script' ? 'script' : 'cli';
|
|
2279
2279
|
const vusEnvName = sanitizeLoadEnvName(cfg.vusEnvName, 'SMOKE_VUS');
|
|
2280
2280
|
const durationEnvName = sanitizeLoadEnvName(cfg.durationEnvName, 'SMOKE_DURATION');
|
|
2281
|
+
const hasVus = cfg.vus !== undefined && cfg.vus !== null && String(cfg.vus).trim() !== '';
|
|
2282
|
+
const hasDuration = cfg.duration !== undefined && cfg.duration !== null && String(cfg.duration).trim() !== '';
|
|
2281
2283
|
envVars.BASE_URL = baseUrl;
|
|
2282
2284
|
const config = {
|
|
2283
|
-
vus: normalizeLoadVus(cfg.vus),
|
|
2284
|
-
duration: normalizeLoadDuration(cfg.duration),
|
|
2285
|
+
vus: hasVus ? normalizeLoadVus(cfg.vus) : undefined,
|
|
2286
|
+
duration: hasDuration ? normalizeLoadDuration(cfg.duration) : undefined,
|
|
2285
2287
|
baseUrl,
|
|
2286
2288
|
scriptName: sanitizeLoadScriptName(cfg.scriptName),
|
|
2287
2289
|
executionMode,
|
|
@@ -2296,8 +2298,10 @@ function startServer({ data: initialData, port, projectRoot }) {
|
|
|
2296
2298
|
envVars: redactLoadEnvVars(envVars),
|
|
2297
2299
|
};
|
|
2298
2300
|
if (executionMode === 'script') {
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
+
if (hasVus && config.vus != null)
|
|
2302
|
+
envVars[vusEnvName] = String(config.vus);
|
|
2303
|
+
if (hasDuration && config.duration)
|
|
2304
|
+
envVars[durationEnvName] = config.duration;
|
|
2301
2305
|
config.envVars = redactLoadEnvVars(envVars);
|
|
2302
2306
|
}
|
|
2303
2307
|
return { config, envVars, dataDir, resultDir };
|
|
@@ -5130,8 +5134,6 @@ a{color:var(--blue)}
|
|
|
5130
5134
|
date,
|
|
5131
5135
|
script,
|
|
5132
5136
|
fileName,
|
|
5133
|
-
vus: normalizeLoadVus(vus),
|
|
5134
|
-
duration: normalizeLoadDuration(duration),
|
|
5135
5137
|
baseUrl: typeof baseUrl === 'string' && baseUrl.trim() ? baseUrl.trim() : 'http://localhost:5000',
|
|
5136
5138
|
executionMode: executionMode === 'script' ? 'script' : 'cli',
|
|
5137
5139
|
vusEnvName: sanitizeLoadEnvName(vusEnvName, 'SMOKE_VUS'),
|
|
@@ -5341,7 +5343,7 @@ a{color:var(--blue)}
|
|
|
5341
5343
|
}
|
|
5342
5344
|
const args = ['run'];
|
|
5343
5345
|
if (loadConfig.executionMode !== 'script') {
|
|
5344
|
-
args.push('--vus', String(loadConfig.vus), '--duration', loadConfig.duration);
|
|
5346
|
+
args.push('--vus', String(loadConfig.vus || 10), '--duration', loadConfig.duration || '30s');
|
|
5345
5347
|
}
|
|
5346
5348
|
args.push(...envFlags, '--summary-export', summaryPath, '--out', `json=${jsonOutPath}`, scriptPath);
|
|
5347
5349
|
loadProc = (0, child_process_1.spawn)('k6', args, {
|