@@ -362,7 +362,9 @@ function summarizeTests(tests) {
362362 } , { totalStart : 0 , totalEnd : 0 , maxAccuracy : 0 , totalTime : 0 , crashCount : 0 } ) ;
363363}
364364
365- function buildStats ( summary ) {
365+ function buildStats ( jsonData ) {
366+ const summary = summarizeTests ( jsonData . tests ) ;
367+
366368 return Element ( "div" , { id : "large" } , [
367369 Element ( "div" , { } , [
368370 "Average Percentage Accurate: " ,
@@ -380,26 +382,21 @@ function buildStats(summary) {
380382 Element ( "span" , {
381383 classList : "number" ,
382384 title : "Crashes and timeouts are considered bad runs."
383- } , [ `${ summary . crashCount } /${ summary . testCount } ` ] )
385+ } , [ `${ summary . crashCount } /${ jsonData . tests . length } ` ] )
384386 ] ) ,
385387 Element ( "div" , { } , [
386388 "Speedup:" ,
387389 Element ( "span" , {
388390 classList : "number" ,
389391 title : "Aggregate speedup of fastest alternative that improves accuracy."
390- } , [ calculateSpeedup ( summary . mergedCostAccuracy ) ] )
392+ } , [ calculateSpeedup ( jsonData [ "merged-cost-accuracy" ] ) ] )
391393 ] ) ,
392394 ] ) ;
393395}
394396
395397function buildBody ( jsonData , otherJsonData ) {
396398 const filterFunction = makeFilterFunction ( ) ;
397-
398- const summary = summarizeTests ( jsonData . tests ) ;
399- summary . testCount = jsonData . tests . length ;
400- summary . mergedCostAccuracy = jsonData [ "merged-cost-accuracy" ] ;
401-
402- const stats = buildStats ( summary ) ;
399+ const stats = buildStats ( jsonData ) ;
403400
404401 const header = buildHeader ( "Herbie Results" )
405402
0 commit comments