File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -460,7 +460,16 @@ impl ArtifactDescription {
460
460
let bootstrap = conn
461
461
. get_bootstrap_by_crate ( & [ conn. artifact_id ( & artifact) . await ] )
462
462
. await ;
463
- let bootstrap = bootstrap
463
+ let total_bootstrap = bootstrap
464
+ . values ( )
465
+ . filter_map ( |v| {
466
+ v. get ( 0 )
467
+ . copied ( )
468
+ . unwrap_or_default ( )
469
+ . map ( |v| v. as_nanos ( ) as u64 )
470
+ } )
471
+ . sum :: < u64 > ( ) ;
472
+ let mut bootstrap = bootstrap
464
473
. into_iter ( )
465
474
. filter_map ( |( k, mut v) | {
466
475
v. pop ( )
@@ -478,6 +487,8 @@ impl ArtifactDescription {
478
487
} )
479
488
. collect :: < HashMap < _ , _ > > ( ) ;
480
489
490
+ bootstrap. insert ( "$total" . to_owned ( ) , total_bootstrap) ;
491
+
481
492
let pr = if let ArtifactId :: Commit ( c) = & artifact {
482
493
if let Some ( m) = master_commits. iter ( ) . find ( |m| m. sha == c. sha ) {
483
494
m. pr
Original file line number Diff line number Diff line change @@ -610,9 +610,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
610
610
return testCases ;
611
611
} ,
612
612
bootstrapTotals ( ) {
613
- const sum = bootstrap => Object . entries ( bootstrap ) . map ( e => e [ 1 ] / 1e9 ) . reduce ( ( sum , next ) => sum + next , 0 ) ;
614
- const a = sum ( this . data . a . bootstrap ) ;
615
- const b = sum ( this . data . b . bootstrap ) ;
613
+ const a = this . data . a . bootstrap [ "$total" ] / 1e9 ;
614
+ const b = this . data . b . bootstrap [ "$total" ] / 1e9 ;
616
615
return { a, b } ;
617
616
} ,
618
617
bootstraps ( ) {
@@ -628,7 +627,9 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
628
627
b : format ( b ) ,
629
628
percent : 100 * ( b - a ) / a
630
629
} ;
631
- } ) . sort ( ( a , b ) => Math . abs ( b . percent ) - Math . abs ( a . percent ) ) ;
630
+ } )
631
+ . filter ( e => e . name != "$total" )
632
+ . sort ( ( a , b ) => Math . abs ( b . percent ) - Math . abs ( a . percent ) ) ;
632
633
} ,
633
634
before ( ) {
634
635
if ( ! this . data ) {
@@ -814,4 +815,4 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
814
815
</ script >
815
816
</ body >
816
817
817
- </ html >
818
+ </ html >
You can’t perform that action at this time.
0 commit comments