11import { filesize } from 'filesize' ;
22
33import { GitHash } from '../util/git.js' ;
4+ import { JsonStringify } from '../util/json.js' ;
45import { AnalyticsFunction , MetricsStats , NumberProvider } from './metrics-stats.js' ;
56import { Result } from './result.js' ;
67import { ResultsSet } from './results-set.js' ;
@@ -13,19 +14,20 @@ export class ResultsAnalyzer {
1314 const items = new ResultsAnalyzer ( currentResult ) . _collect ( ) ;
1415
1516 const baseline = baselineResults ?. find (
16- ( other ) => other . cpuThrottling == currentResult . cpuThrottling &&
17- other . name == currentResult . name &&
18- other . networkConditions == currentResult . networkConditions ) ;
17+ ( other ) => other . cpuThrottling == currentResult . cpuThrottling
18+ && other . name == currentResult . name
19+ && other . networkConditions == currentResult . networkConditions
20+ && JsonStringify ( other ) != JsonStringify ( currentResult ) ) ;
1921
2022 let otherHash : GitHash | undefined
2123 if ( baseline != undefined ) {
24+ otherHash = baseline [ 0 ] ;
2225 const baseItems = new ResultsAnalyzer ( baseline [ 1 ] ) . _collect ( ) ;
2326 // update items with baseline results
2427 for ( const base of baseItems ) {
2528 for ( const item of items ) {
2629 if ( item . metric == base . metric ) {
2730 item . others = base . values ;
28- otherHash = baseline [ 0 ] ;
2931 }
3032 }
3133 }
0 commit comments