File tree 4 files changed +15
-6
lines changed
4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ const result = await collector.execute({
39
39
40
40
const cpuUsage = stats . mean ( MetricsStats . cpu ) ! ;
41
41
if ( cpuUsage > 0.85 ) {
42
+ // Note: complexity on the "JankTest" is defined by the `minimum = ...,` setting in app.js - specifying the number of animated elements.
42
43
console . warn ( `✗ | Discarding results because CPU usage is too high and may be inaccurate: ${ ( cpuUsage * 100 ) . toFixed ( 2 ) } %.` ,
43
44
'Consider simplifying the scenario or changing the CPU throttling factor.' ) ;
44
45
return false ;
Original file line number Diff line number Diff line change @@ -83,16 +83,16 @@ class AnalyzerItemNumberValue implements AnalyzerItemValue {
83
83
84
84
public get diff ( ) : string {
85
85
const diff = this . _b - this . _a ;
86
- const str = this . _withUnit ( diff ) ;
86
+ const str = this . _withUnit ( diff , true ) ;
87
87
return diff > 0 ? `+${ str } ` : str ;
88
88
}
89
89
90
- private _withUnit ( value : number ) : string {
90
+ private _withUnit ( value : number , isDiff : boolean = false ) : string {
91
91
switch ( this . _unit ) {
92
92
case AnalyzerItemUnit . bytes :
93
93
return filesize ( value ) as string ;
94
94
case AnalyzerItemUnit . ratio :
95
- return `${ ( value * 100 ) . toFixed ( 2 ) } % ` ;
95
+ return `${ ( value * 100 ) . toFixed ( 2 ) } ${ isDiff ? 'pp' : '%' } ` ;
96
96
default :
97
97
return `${ value . toFixed ( 2 ) } ${ AnalyzerItemUnit [ this . _unit ] } ` ;
98
98
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Result } from './result.js';
4
4
import { ResultSetItem } from './results-set.js' ;
5
5
6
6
function trimIndent ( str : string ) : string {
7
- return str . split ( '\n' ) . map ( s => s . trim ( ) ) . join ( '\n' ) ;
7
+ return str . trim ( ) . split ( '\n' ) . map ( s => s . trim ( ) ) . join ( '\n' ) ;
8
8
}
9
9
10
10
function printableMetricName ( metric : AnalyzerItemMetric ) : string {
@@ -32,7 +32,15 @@ export class PrCommentBuilder {
32
32
}
33
33
34
34
public get body ( ) : string {
35
- return trimIndent ( this . _buffer ) ;
35
+ const now = new Date ( ) ;
36
+ return trimIndent ( `
37
+ ${ this . _buffer }
38
+ <hr />
39
+ <div align="right">
40
+ CPU usage difference is shown as <a href="https://en.wikipedia.org/wiki/Percentage_point">percentage points</a>. <br />
41
+ Last updated: <time datetime="${ now . toISOString ( ) } ">${ now . toUTCString ( ) } </time>
42
+ </div>
43
+ ` ) ;
36
44
}
37
45
38
46
public async addCurrentResult ( analysis : Analysis , otherName : string ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ document.addEventListener("DOMContentLoaded", function() {
25
25
incrementor = 10 ,
26
26
distance = 3 ,
27
27
frame ,
28
- minimum = 30 ,
28
+ minimum = 70 ,
29
29
subtract = document . querySelector ( '.subtract' ) ,
30
30
add = document . querySelector ( '.add' ) ;
31
31
You can’t perform that action at this time.
0 commit comments