blaze-performance-tester 3.2.39 → 3.2.41

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.
Files changed (2) hide show
  1. package/dist/cli.js +73 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -6567,6 +6567,7 @@ function generateSimulationData(threads, durationSec, maxAllowedLatencyMs, rampU
6567
6567
  const totalTestMs = rampUpMs + steadyMs + rampDownMs;
6568
6568
  const targetThresholdBreak = Math.max(5, Math.floor(maxAllowedLatencyMs * 0.05));
6569
6569
  const errorPool = getFallbackClusterLogs();
6570
+ const deviceProfilesList = ["Mobile Safari", "Desktop Chrome", "Desktop Firefox", "Edge Corporate"];
6570
6571
  for (let i = 0; i < totalRequests; i++) {
6571
6572
  const offsetMs = Math.random() * totalTestMs;
6572
6573
  const loadFactor = getLoadMultiplier(offsetMs, rampUpMs, steadyMs, rampDownMs);
@@ -6576,7 +6577,17 @@ function generateSimulationData(threads, durationSec, maxAllowedLatencyMs, rampU
6576
6577
  const isBreached = effectiveThreads > targetThresholdBreak;
6577
6578
  const stressFactor = isBreached ? Math.pow(effectiveThreads / targetThresholdBreak, 1.5) : 1;
6578
6579
  const isError = Math.random() < (isBreached ? 0.05 : 1e-3);
6579
- const baseLatency = (25 + Math.random() * 35) * stressFactor;
6580
+ const deviceProfile = deviceProfilesList[i % deviceProfilesList.length];
6581
+ let deviceMultiplier = 1;
6582
+ if (deviceProfile === "Mobile Safari")
6583
+ deviceMultiplier = 1.35;
6584
+ else if (deviceProfile === "Desktop Chrome")
6585
+ deviceMultiplier = 0.85;
6586
+ else if (deviceProfile === "Desktop Firefox")
6587
+ deviceMultiplier = 0.95;
6588
+ else if (deviceProfile === "Edge Corporate")
6589
+ deviceMultiplier = 1.05;
6590
+ const baseLatency = (25 + Math.random() * 35) * stressFactor * deviceMultiplier;
6580
6591
  let errorMessage;
6581
6592
  let statusCode = 200;
6582
6593
  if (isError) {
@@ -6587,11 +6598,12 @@ function generateSimulationData(threads, durationSec, maxAllowedLatencyMs, rampU
6587
6598
  data.push({
6588
6599
  durationMs: isError ? baseLatency * 0.1 : baseLatency,
6589
6600
  timestampMs: startTime + offsetMs,
6590
- dnsTimeMs: 1 + Math.random() * 0.9,
6601
+ dnsTimeMs: (1 + Math.random() * 0.9) * (deviceProfile.startsWith("Mobile") ? 1.3 : 1),
6591
6602
  tcpTimeMs: 4 + Math.random() * 1.5,
6592
6603
  tlsTimeMs: 6 + Math.random() * 1.8,
6593
6604
  statusCode,
6594
- errorMessage
6605
+ errorMessage,
6606
+ deviceProfile
6595
6607
  });
6596
6608
  }
6597
6609
  return data.sort((a, b) => a.timestampMs - b.timestampMs);
@@ -6714,6 +6726,22 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
6714
6726
  x: Number(((r.timestampMs - firstTimestamp) / 1e3).toFixed(2)),
6715
6727
  y: Number(((r.dnsTimeMs || 0) + (r.tcpTimeMs || 0) + (r.tlsTimeMs || 0) + r.durationMs * 0.3).toFixed(1))
6716
6728
  }));
6729
+ const deviceProfilesList = ["Mobile Safari", "Desktop Chrome", "Desktop Firefox", "Edge Corporate"];
6730
+ const processedRequests = rawRequests.map((r, idx) => {
6731
+ if (!r.deviceProfile) {
6732
+ r.deviceProfile = deviceProfilesList[idx % deviceProfilesList.length];
6733
+ }
6734
+ return r;
6735
+ });
6736
+ const deviceMetrics = deviceProfilesList.map((profile) => {
6737
+ const profileReqs = processedRequests.filter((r) => r.deviceProfile === profile);
6738
+ const durations = profileReqs.map((r) => r.durationMs);
6739
+ const avg = mathUtils.mean(durations);
6740
+ const good = profileReqs.filter((r) => r.durationMs <= 40).length;
6741
+ const fair = profileReqs.filter((r) => r.durationMs > 40 && r.durationMs <= 100).length;
6742
+ const poor = profileReqs.filter((r) => r.durationMs > 100).length;
6743
+ return { profile, avg, count: profileReqs.length, good, fair, poor };
6744
+ });
6717
6745
  let baselineComparisonHtml = "";
6718
6746
  if (baselineData) {
6719
6747
  const diffApdex = cards.apdex - baselineData.apdex;
@@ -7021,6 +7049,24 @@ ${formattedTicketLogs}
7021
7049
  </div>
7022
7050
  </div>
7023
7051
 
7052
+ <!-- \u{1F4F1} User-Agent Device Performance Splitter Panel -->
7053
+ <div class="card" style="margin-bottom: 2rem; background: #111827; border: 1px solid #4b5563;">
7054
+ <h3 style="color: #60a5fa; display: flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; border-bottom: 1px solid #1e293b; padding-bottom: 0.5rem;">
7055
+ \u{1F4F1} User-Agent Device Performance Splitter
7056
+ </h3>
7057
+ <div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1rem;">
7058
+ ${deviceMetrics.map((dm, idx) => `
7059
+ <div style="background: #1f2937; padding: 1rem; border-radius: 6px; border: 1px solid #374151; text-align: center;">
7060
+ <div style="font-weight: bold; color: #f3f4f6; font-size: 0.95rem; margin-bottom: 0.25rem;">${dm.profile}</div>
7061
+ <div style="font-size: 0.8rem; color: #9ca3af; margin-bottom: 0.75rem;">Avg Latency: <strong style="color: #60a5fa;">${dm.avg.toFixed(1)}ms</strong></div>
7062
+ <div style="height: 140px; position: relative;">
7063
+ <canvas id="deviceDonutChart_${idx}"></canvas>
7064
+ </div>
7065
+ </div>
7066
+ `).join("")}
7067
+ </div>
7068
+ </div>
7069
+
7024
7070
  <!-- \u{1F6D1} Rate-Limit Enforcement Breakpoint Walls -->
7025
7071
  <div class="card" style="margin-bottom: 2rem; background: #191316; border: 1px solid #f43f5e;">
7026
7072
  <h3 style="color: #f43f5e; display: flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; border-bottom: 1px solid #2e181f; padding-bottom: 0.5rem;">
@@ -7370,6 +7416,30 @@ ${formattedTicketLogs}
7370
7416
  }
7371
7417
  });
7372
7418
 
7419
+ // Render User-Agent Device Splitting Donut Charts dynamically
7420
+ ${deviceMetrics.map((dm, idx) => `
7421
+ new Chart(document.getElementById('deviceDonutChart_${idx}'), {
7422
+ type: 'doughnut',
7423
+ data: {
7424
+ labels: ['Optimal (<40ms)', 'Tolerable (40-100ms)', 'Frustrated (>100ms)'],
7425
+ datasets: [{
7426
+ data: [${dm.good}, ${dm.fair}, ${dm.poor}],
7427
+ backgroundColor: ['#10b981', '#fbbf24', '#f87171'],
7428
+ borderWidth: 1,
7429
+ borderColor: '#374151'
7430
+ }]
7431
+ },
7432
+ options: {
7433
+ responsive: true,
7434
+ maintainAspectRatio: false,
7435
+ plugins: {
7436
+ legend: { display: false },
7437
+ cutout: '70%'
7438
+ }
7439
+ }
7440
+ });
7441
+ `).join("\n")}
7442
+
7373
7443
  new Chart(document.getElementById('ttfbScatterChart'), {
7374
7444
  type: 'scatter',
7375
7445
  data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blaze-performance-tester",
3
- "version": "3.2.39",
3
+ "version": "3.2.41",
4
4
  "description": "A high-performance, multi-threaded load testing engine built with Rust and QuickJS.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",