playwright-network-metrics 0.2.0 → 0.2.1
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/index.js +11 -15
- package/dist/index.mjs +11 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -381,13 +381,13 @@ function generateHtmlReport(report) {
|
|
|
381
381
|
|
|
382
382
|
.grid-wrapper { background: var(--card-bg); border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--border); overflow: hidden; }
|
|
383
383
|
.grid-table { overflow-x: auto; }
|
|
384
|
-
.grid-header, .grid-row { display: grid; grid-template-columns: minmax(300px, 4fr) 110px
|
|
385
|
-
.grid-header { background: #f8fafc; font-weight: 700; color: var(--secondary); font-size: 0.85rem; text-transform: uppercase; width: fit-content; }
|
|
384
|
+
.grid-header, .grid-row { display: grid; grid-template-columns: minmax(300px, 4fr) 110px 160px 160px 160px 160px 120px; align-items: center; border-bottom: 1px solid var(--border); }
|
|
385
|
+
.grid-header { background: #f8fafc; font-weight: 700; color: var(--secondary); font-size: 0.85rem; text-transform: uppercase; width: fit-content; min-width: 100%; }
|
|
386
386
|
.grid-cell { padding: 14px 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
387
387
|
.grid-header .grid-cell { cursor: pointer; position: relative; display: flex; align-items: center; gap: 4px; }
|
|
388
388
|
.grid-header .grid-cell:hover { background: #f1f5f9; }
|
|
389
389
|
|
|
390
|
-
#grid-body { width: fit-content; }
|
|
390
|
+
#grid-body { width: fit-content; min-width: 100%; }
|
|
391
391
|
|
|
392
392
|
.grid-row { cursor: pointer; transition: background 0.1s; background: white; }
|
|
393
393
|
.grid-row:hover { background: #fcfdfe; }
|
|
@@ -477,12 +477,10 @@ function generateHtmlReport(report) {
|
|
|
477
477
|
const columnMeta = {
|
|
478
478
|
key: { label: 'Endpoint / Key', tooltip: 'The unique identifier for this aggregation group.' },
|
|
479
479
|
count: { label: 'Count', tooltip: 'Total number of requests made.' },
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
p99: { label: 'P99', tooltip: '99th Percentile: Only 1% of requests were slower than this value. Critical for tail latency optimization.' },
|
|
485
|
-
totalDurationMs: { label: 'Total Time', tooltip: 'Sum of all response times for this group.' },
|
|
480
|
+
avgLoadTimeMs: { label: 'Avg Load', tooltip: 'Resource Load Time: The time taken to download the resource body (responseEnd - responseStart).' },
|
|
481
|
+
avgDurationMs: { label: 'Avg Duration', tooltip: 'The average response time in milliseconds. This represents the total time from request start to the end of the response body.' },
|
|
482
|
+
totalLoadTimeMs: { label: 'Total Load', tooltip: 'Sum of all load times for this group.' },
|
|
483
|
+
totalDurationMs: { label: 'Total Duration', tooltip: 'Sum of all response times for this group.' },
|
|
486
484
|
errorCount: { label: 'Errors', tooltip: 'Number of failed requests (non-2xx response or network error).' }
|
|
487
485
|
};
|
|
488
486
|
|
|
@@ -529,7 +527,7 @@ function generateHtmlReport(report) {
|
|
|
529
527
|
const header = document.getElementById('grid-header');
|
|
530
528
|
const body = document.getElementById('grid-body');
|
|
531
529
|
|
|
532
|
-
const columns = ['key', 'count', '
|
|
530
|
+
const columns = ['key', 'count', 'avgLoadTimeMs', 'totalLoadTimeMs', 'avgDurationMs', 'totalDurationMs', 'errorCount'];
|
|
533
531
|
|
|
534
532
|
header.innerHTML = columns.map(k => \`
|
|
535
533
|
<div class="grid-cell" onclick="handleSort('\${k}')">
|
|
@@ -550,11 +548,9 @@ function generateHtmlReport(report) {
|
|
|
550
548
|
<span class="endpoint-key" title="\${item.key}">\${item.method ? item.key.replace(new RegExp(\`^\${item.method}\\\\s+\`), '') : item.key}</span>
|
|
551
549
|
</div>
|
|
552
550
|
<div class="grid-cell">\${item.count}</div>
|
|
553
|
-
<div class="grid-cell">\${formatMs(item.avgDurationMs)}</div>
|
|
554
551
|
<div class="grid-cell">\${formatMs(item.avgLoadTimeMs)}</div>
|
|
555
|
-
<div class="grid-cell">\${formatMs(item.
|
|
556
|
-
<div class="grid-cell">\${formatMs(item.
|
|
557
|
-
<div class="grid-cell">\${formatMs(item.p99)}</div>
|
|
552
|
+
<div class="grid-cell">\${formatMs(item.totalLoadTimeMs)}</div>
|
|
553
|
+
<div class="grid-cell">\${formatMs(item.avgDurationMs)}</div>
|
|
558
554
|
<div class="grid-cell">\${formatMs(item.totalDurationMs)}</div>
|
|
559
555
|
<div class="grid-cell \${item.errorCount > 0 ? 'error-tag' : ''}">\${item.errorCount}</div>
|
|
560
556
|
</div>
|
|
@@ -629,7 +625,7 @@ var NetworkMetricsReporter = class {
|
|
|
629
625
|
};
|
|
630
626
|
onBegin(config) {
|
|
631
627
|
const reporterEntry = config.reporter.find(
|
|
632
|
-
([name]) => name
|
|
628
|
+
([name]) => name.includes("playwright-network-metrics")
|
|
633
629
|
);
|
|
634
630
|
if (reporterEntry && typeof reporterEntry[1] === "object") {
|
|
635
631
|
this.config = {
|
package/dist/index.mjs
CHANGED
|
@@ -343,13 +343,13 @@ function generateHtmlReport(report) {
|
|
|
343
343
|
|
|
344
344
|
.grid-wrapper { background: var(--card-bg); border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--border); overflow: hidden; }
|
|
345
345
|
.grid-table { overflow-x: auto; }
|
|
346
|
-
.grid-header, .grid-row { display: grid; grid-template-columns: minmax(300px, 4fr) 110px
|
|
347
|
-
.grid-header { background: #f8fafc; font-weight: 700; color: var(--secondary); font-size: 0.85rem; text-transform: uppercase; width: fit-content; }
|
|
346
|
+
.grid-header, .grid-row { display: grid; grid-template-columns: minmax(300px, 4fr) 110px 160px 160px 160px 160px 120px; align-items: center; border-bottom: 1px solid var(--border); }
|
|
347
|
+
.grid-header { background: #f8fafc; font-weight: 700; color: var(--secondary); font-size: 0.85rem; text-transform: uppercase; width: fit-content; min-width: 100%; }
|
|
348
348
|
.grid-cell { padding: 14px 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
349
349
|
.grid-header .grid-cell { cursor: pointer; position: relative; display: flex; align-items: center; gap: 4px; }
|
|
350
350
|
.grid-header .grid-cell:hover { background: #f1f5f9; }
|
|
351
351
|
|
|
352
|
-
#grid-body { width: fit-content; }
|
|
352
|
+
#grid-body { width: fit-content; min-width: 100%; }
|
|
353
353
|
|
|
354
354
|
.grid-row { cursor: pointer; transition: background 0.1s; background: white; }
|
|
355
355
|
.grid-row:hover { background: #fcfdfe; }
|
|
@@ -439,12 +439,10 @@ function generateHtmlReport(report) {
|
|
|
439
439
|
const columnMeta = {
|
|
440
440
|
key: { label: 'Endpoint / Key', tooltip: 'The unique identifier for this aggregation group.' },
|
|
441
441
|
count: { label: 'Count', tooltip: 'Total number of requests made.' },
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
p99: { label: 'P99', tooltip: '99th Percentile: Only 1% of requests were slower than this value. Critical for tail latency optimization.' },
|
|
447
|
-
totalDurationMs: { label: 'Total Time', tooltip: 'Sum of all response times for this group.' },
|
|
442
|
+
avgLoadTimeMs: { label: 'Avg Load', tooltip: 'Resource Load Time: The time taken to download the resource body (responseEnd - responseStart).' },
|
|
443
|
+
avgDurationMs: { label: 'Avg Duration', tooltip: 'The average response time in milliseconds. This represents the total time from request start to the end of the response body.' },
|
|
444
|
+
totalLoadTimeMs: { label: 'Total Load', tooltip: 'Sum of all load times for this group.' },
|
|
445
|
+
totalDurationMs: { label: 'Total Duration', tooltip: 'Sum of all response times for this group.' },
|
|
448
446
|
errorCount: { label: 'Errors', tooltip: 'Number of failed requests (non-2xx response or network error).' }
|
|
449
447
|
};
|
|
450
448
|
|
|
@@ -491,7 +489,7 @@ function generateHtmlReport(report) {
|
|
|
491
489
|
const header = document.getElementById('grid-header');
|
|
492
490
|
const body = document.getElementById('grid-body');
|
|
493
491
|
|
|
494
|
-
const columns = ['key', 'count', '
|
|
492
|
+
const columns = ['key', 'count', 'avgLoadTimeMs', 'totalLoadTimeMs', 'avgDurationMs', 'totalDurationMs', 'errorCount'];
|
|
495
493
|
|
|
496
494
|
header.innerHTML = columns.map(k => \`
|
|
497
495
|
<div class="grid-cell" onclick="handleSort('\${k}')">
|
|
@@ -512,11 +510,9 @@ function generateHtmlReport(report) {
|
|
|
512
510
|
<span class="endpoint-key" title="\${item.key}">\${item.method ? item.key.replace(new RegExp(\`^\${item.method}\\\\s+\`), '') : item.key}</span>
|
|
513
511
|
</div>
|
|
514
512
|
<div class="grid-cell">\${item.count}</div>
|
|
515
|
-
<div class="grid-cell">\${formatMs(item.avgDurationMs)}</div>
|
|
516
513
|
<div class="grid-cell">\${formatMs(item.avgLoadTimeMs)}</div>
|
|
517
|
-
<div class="grid-cell">\${formatMs(item.
|
|
518
|
-
<div class="grid-cell">\${formatMs(item.
|
|
519
|
-
<div class="grid-cell">\${formatMs(item.p99)}</div>
|
|
514
|
+
<div class="grid-cell">\${formatMs(item.totalLoadTimeMs)}</div>
|
|
515
|
+
<div class="grid-cell">\${formatMs(item.avgDurationMs)}</div>
|
|
520
516
|
<div class="grid-cell">\${formatMs(item.totalDurationMs)}</div>
|
|
521
517
|
<div class="grid-cell \${item.errorCount > 0 ? 'error-tag' : ''}">\${item.errorCount}</div>
|
|
522
518
|
</div>
|
|
@@ -591,7 +587,7 @@ var NetworkMetricsReporter = class {
|
|
|
591
587
|
};
|
|
592
588
|
onBegin(config) {
|
|
593
589
|
const reporterEntry = config.reporter.find(
|
|
594
|
-
([name]) => name
|
|
590
|
+
([name]) => name.includes("playwright-network-metrics")
|
|
595
591
|
);
|
|
596
592
|
if (reporterEntry && typeof reporterEntry[1] === "object") {
|
|
597
593
|
this.config = {
|
package/package.json
CHANGED