@@ -9,7 +9,7 @@ function findQueryParam(name) {
9
9
function createDefaultFilter ( ) {
10
10
return {
11
11
name : null ,
12
- showNonRelevant : false ,
12
+ nonRelevant : false ,
13
13
profile : {
14
14
check : true ,
15
15
debug : true ,
@@ -107,7 +107,7 @@ const app = Vue.createApp({
107
107
let nameFilter = filter . name && filter . name . trim ( ) ;
108
108
nameFilter = ! nameFilter || name . includes ( nameFilter ) ;
109
109
110
- const relevanceFilter = filter . showNonRelevant ? true : testCase . isRelevant ;
110
+ const relevanceFilter = filter . nonRelevant ? true : testCase . isRelevant ;
111
111
112
112
return (
113
113
profileFilter ( testCase . profile ) &&
@@ -391,18 +391,34 @@ app.component('test-cases-table', {
391
391
const SummaryPercentValue = {
392
392
props : {
393
393
value : Number ,
394
+ padWidth : {
395
+ type : Number ,
396
+ default : null
397
+ }
394
398
} ,
395
399
template : `
396
- <span>{{ value.toFixed(2) }}%</span>
397
- `
400
+ <span><span v-html="padSpaces" />{{ formattedValue }}%</span>
401
+ ` ,
402
+ computed : {
403
+ formattedValue ( ) {
404
+ return `${ this . signIfPositive ( this . value ) } ${ this . value . toFixed ( 2 ) } ` ;
405
+ } ,
406
+ padSpaces ( ) {
407
+ let value = this . formattedValue ;
408
+ if ( value . length < this . padWidth ) {
409
+ return " " . repeat ( this . padWidth - value . length ) ;
410
+ }
411
+ return "" ;
412
+ }
413
+ }
398
414
} ;
399
415
const SummaryRange = {
400
416
props : {
401
417
range : Array ,
402
418
} ,
403
419
template : `
404
420
<div v-if="range.length > 0">
405
- [<SummaryPercentValue :value="range[0]" />, <SummaryPercentValue :value="range[1]" />]
421
+ [<SummaryPercentValue :value="range[0]" :padWidth="6" />, <SummaryPercentValue :value="range[1]" :padWidth="6" />]
406
422
</div>
407
423
<div v-else>-</div>
408
424
` , components : { SummaryPercentValue}
@@ -422,29 +438,29 @@ app.component('summary-table', {
422
438
template : `
423
439
<table class="summary-table">
424
440
<thead>
441
+ <th><!-- icon --></th>
425
442
<th>Range</th>
426
443
<th>Mean</th>
427
444
<th>Count</th>
428
- <th><!-- icon --></th>
429
445
</thead>
430
446
<tbody>
431
447
<tr class="positive">
448
+ <td title="Regresions">❌</td>
432
449
<td><SummaryRange :range="cases.regressions.range" /></td>
433
450
<td><SummaryPercentValue :value="cases.regressions.average" /></td>
434
451
<td><SummaryCount :cases="cases.regressions.count" :benchmarks="cases.regressions.benchmarks" /></td>
435
- <td title="Regresions">❌</td>
436
452
</tr>
437
453
<tr class="negative">
454
+ <td title="Improvements">✅</td>
438
455
<td><SummaryRange :range="cases.improvements.range" /></td>
439
456
<td><SummaryPercentValue :value="cases.improvements.average" /></td>
440
457
<td><SummaryCount :cases="cases.improvements.count" :benchmarks="cases.improvements.benchmarks" /></td>
441
- <td title="Improvements">✅</td>
442
458
</tr>
443
459
<tr>
460
+ <td title="All changes">✅,❌</td>
444
461
<td><SummaryRange :range="cases.all.range" /></td>
445
462
<td><SummaryPercentValue :value="cases.all.average" /></td>
446
463
<td><SummaryCount :cases="cases.all.count" :benchmarks="cases.all.benchmarks" /></td>
447
- <td></td>
448
464
</tr>
449
465
</tbody>
450
466
</table>
@@ -537,9 +553,6 @@ function computeSummary(testCases) {
537
553
Math . min . apply ( null , values ) ,
538
554
Math . max . apply ( null , values ) ,
539
555
] ;
540
- if ( Math . abs ( range [ 0 ] ) > Math . abs ( range [ 1 ] ) ) {
541
- range = [ range [ 1 ] , range [ 0 ] ] ;
542
- }
543
556
}
544
557
545
558
const sum = values . reduce ( ( acc , item ) => acc + item , 0 ) ;
0 commit comments