viberadar 0.3.220 → 0.3.221
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/ui/dashboard.html +31 -17
- package/package.json +1 -1
package/dist/ui/dashboard.html
CHANGED
|
@@ -8441,23 +8441,37 @@ async function stopLoadTest() {
|
|
|
8441
8441
|
try { await fetch('/api/load/stop', { method: 'POST' }); } catch {}
|
|
8442
8442
|
}
|
|
8443
8443
|
|
|
8444
|
-
async function loadAiAnalysis() {
|
|
8445
|
-
if (!loadState || !loadState.summary) return;
|
|
8446
|
-
const summary = loadState.summary;
|
|
8447
|
-
const logs = loadState.logs || [];
|
|
8448
|
-
const
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
${
|
|
8459
|
-
|
|
8460
|
-
|
|
8444
|
+
async function loadAiAnalysis() {
|
|
8445
|
+
if (!loadState || !loadState.summary) return;
|
|
8446
|
+
const summary = loadState.summary;
|
|
8447
|
+
const logs = loadState.logs || [];
|
|
8448
|
+
const totalRequests = Number(summary.totalRequests || loadState.totalRequests || 0);
|
|
8449
|
+
if (totalRequests <= 0 && logs.length === 0) {
|
|
8450
|
+
alert('Для AI-анализа нет данных: в выбранном прогоне 0 запросов и пустой лог k6. Открой завершённый run с результатами или скопируй лог ошибки вручную.');
|
|
8451
|
+
return;
|
|
8452
|
+
}
|
|
8453
|
+
const prompt = `Проанализируй результаты нагрузочного тестирования k6:
|
|
8454
|
+
|
|
8455
|
+
Run ID: ${loadState.runId || '—'}
|
|
8456
|
+
Status: ${loadState.status || '—'}
|
|
8457
|
+
Result path: ${loadState.config?.resultPath || '—'}
|
|
8458
|
+
Script: ${loadState.config?.scriptName || '—'}
|
|
8459
|
+
VUs: ${loadState.config?.vus || '—'}
|
|
8460
|
+
Duration: ${loadState.config?.duration || '—'}
|
|
8461
|
+
|
|
8462
|
+
RPS: ${(summary.rps||0).toFixed(2)}
|
|
8463
|
+
avg latency: ${Math.round(summary.avgDuration||0)}ms
|
|
8464
|
+
p90 latency: ${Math.round(summary.p90Duration||0)}ms
|
|
8465
|
+
p95 latency: ${Math.round(summary.p95Duration||0)}ms
|
|
8466
|
+
Total requests: ${totalRequests}
|
|
8467
|
+
Error rate: ${(summary.errorPct||0).toFixed(2)}%
|
|
8468
|
+
Checks failed: ${summary.checksFailed ?? '—'}
|
|
8469
|
+
Exit code: ${summary.exitCode ?? '—'}
|
|
8470
|
+
|
|
8471
|
+
Лог k6:
|
|
8472
|
+
${logs.slice(-120).join('\n') || '(лог пустой)'}
|
|
8473
|
+
|
|
8474
|
+
Оцени: производительность, узкие места, рекомендации по оптимизации.`;
|
|
8461
8475
|
|
|
8462
8476
|
// Open agent terminal and send task
|
|
8463
8477
|
document.getElementById('agentPanel').classList.add('open');
|