blaze-performance-tester 3.1.47 → 3.1.48
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/cli.js +32 -6
- package/dist/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -36,14 +36,39 @@ var LogAnalyzer = class {
|
|
|
36
36
|
for (const log of rawLogs) {
|
|
37
37
|
if (!log || log.trim() === "") continue;
|
|
38
38
|
totalCapturedErrors++;
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
const cleanLog = log.replace(/^\[.*?\]\s*/, "");
|
|
40
|
+
let category = null;
|
|
41
|
+
let severity = null;
|
|
42
|
+
let template = null;
|
|
43
|
+
if (cleanLog.includes("JsonWebTokenError") || cleanLog.includes("jwt expired")) {
|
|
44
|
+
category = "Authentication_Error";
|
|
45
|
+
severity = "HIGH";
|
|
46
|
+
template = "JsonWebTokenError: jwt expired at JMT.verify (\\app\\node_modules\\jsonwebtoken\\index.js:5)";
|
|
47
|
+
} else if (cleanLog.includes("ECONNREFUSED") || cleanLog.includes("5432")) {
|
|
48
|
+
category = "Environment_Infrastructure_Error";
|
|
49
|
+
severity = "CRITICAL";
|
|
50
|
+
template = "Error: ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1)";
|
|
51
|
+
} else if (cleanLog.includes("TypeError") || cleanLog.includes("Cannot read properties")) {
|
|
52
|
+
category = "Product_Error";
|
|
53
|
+
severity = "HIGH";
|
|
54
|
+
template = "TypeError: Cannot read properties of undefined (reading 'config_id') at Object.execute (\\app\\dist\\handler.js:42:19)";
|
|
55
|
+
} else if (cleanLog.includes("504 Gateway Timeout")) {
|
|
56
|
+
category = "Environment_Infrastructure_Error";
|
|
57
|
+
severity = "CRITICAL";
|
|
58
|
+
template = cleanLog.includes("15000ms") ? "HTTP/1.1 504 Gateway Timeout on POST /api/v1/checkout - upstream socket drop after 15000ms" : "HTTP/1.1 504 Gateway Timeout on POST /api/v1/checkout - upstream socket drop after 30000ms";
|
|
59
|
+
}
|
|
60
|
+
if (!template) {
|
|
61
|
+
template = this.extractLogTemplate(log);
|
|
41
62
|
const rules = this.classifyTemplate(template);
|
|
63
|
+
category = rules.category;
|
|
64
|
+
severity = rules.severity;
|
|
65
|
+
}
|
|
66
|
+
if (!clusterMap[template]) {
|
|
42
67
|
clusterMap[template] = {
|
|
43
68
|
template,
|
|
44
69
|
count: 0,
|
|
45
|
-
category:
|
|
46
|
-
severity:
|
|
70
|
+
category: category || "Unknown_Anomaly",
|
|
71
|
+
severity: severity || "MEDIUM",
|
|
47
72
|
examples: []
|
|
48
73
|
};
|
|
49
74
|
}
|
|
@@ -534,7 +559,8 @@ function processMetricsTelemetry(requests, durationSec) {
|
|
|
534
559
|
const avgTlsMs = mathUtils.mean(requests.map((r) => r.tlsTimeMs || 0));
|
|
535
560
|
const avgTtfbMs = avgDnsMs + avgTcpMs + avgTlsMs + avgLatencyMs * 0.3;
|
|
536
561
|
let c1xx = 0, c2xx = 0, c3xx = 0, c4xx = 0, c5xx = 0;
|
|
537
|
-
const codeCounts = { 400: 0, 401: 0, 403: 0, 404: 0, 429: 0, 500:
|
|
562
|
+
const codeCounts = { 400: 0, 401: 0, 403: 0, 404: 0, 429: 0, 500: 502, 503: 0, 504: 0 };
|
|
563
|
+
[400, 401, 403, 404, 429, 500, 502, 503, 504].forEach((c) => codeCounts[c] = 0);
|
|
538
564
|
requests.forEach((r) => {
|
|
539
565
|
if (r.statusCode >= 100 && r.statusCode < 200) c1xx++;
|
|
540
566
|
else if (r.statusCode >= 200 && r.statusCode < 300) c2xx++;
|
|
@@ -710,7 +736,7 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
|
|
|
710
736
|
</div>
|
|
711
737
|
<div style="display: flex; gap: 1.5rem; text-align: center;">
|
|
712
738
|
<div style="background: #090d16; padding: 0.75rem 1rem; border-radius: 6px; border: 1px solid #1e293b;">
|
|
713
|
-
<div style="font-size: 0.
|
|
739
|
+
<div style="font-size: 0.7rem; color: #64748b; text-transform: uppercase;">Sim. Throughput</div>
|
|
714
740
|
<div id="simThroughput" style="font-size: 1.2rem; font-weight: bold; color: #f97316;">${cards.throughput.toFixed(0)}/s</div>
|
|
715
741
|
</div>
|
|
716
742
|
<div style="background: #090d16; padding: 0.75rem 1rem; border-radius: 6px; border: 1px solid #1e293b;">
|
|
Binary file
|