@@ -264,25 +264,27 @@ impl Report for Html {
264
264
. collect :: < Vec < _ > > ( ) ;
265
265
266
266
let mut all_plots = vec ! [ ] ;
267
- let group_id = & all_ids[ 0 ] . group_id ;
267
+ let group_id = all_ids[ 0 ] . group_id . clone ( ) ;
268
+
269
+ let data: Vec < ( BenchmarkId , Vec < f64 > ) > =
270
+ self . load_summary_data ( & context. output_directory , & all_ids) ;
268
271
269
272
let mut function_ids = BTreeSet :: new ( ) ;
270
- for id in & all_ids {
271
- if let Some ( ref function_id) = id. function_id {
273
+ for id in all_ids {
274
+ if let Some ( function_id) = id. function_id {
272
275
function_ids. insert ( function_id) ;
273
276
}
274
277
}
275
278
276
- let data: Vec < ( BenchmarkId , Vec < f64 > ) > =
277
- self . load_summary_data ( & context. output_directory , & all_ids) ;
278
-
279
279
for function_id in function_ids {
280
280
let samples_with_function: Vec < _ > = data. iter ( )
281
281
. by_ref ( )
282
- . filter ( |& & ( ref id, _) | id. function_id . as_ref ( ) == Some ( function_id) )
282
+ . filter ( |& & ( ref id, _) | id. function_id . as_ref ( ) == Some ( & function_id) )
283
283
. collect ( ) ;
284
+
284
285
if samples_with_function. len ( ) > 1 {
285
- let subgroup_id = format ! ( "{}/{}" , group_id, function_id) ;
286
+ let subgroup_id = BenchmarkId :: new ( group_id. clone ( ) , Some ( function_id) , None , None ) ;
287
+
286
288
all_plots. extend ( self . generate_summary (
287
289
& subgroup_id,
288
290
& * samples_with_function,
@@ -293,7 +295,7 @@ impl Report for Html {
293
295
}
294
296
295
297
all_plots. extend ( self . generate_summary (
296
- group_id,
298
+ & BenchmarkId :: new ( group_id, None , None , None ) ,
297
299
& * ( data. iter ( ) . by_ref ( ) . collect :: < Vec < _ > > ( ) ) ,
298
300
context,
299
301
true ,
@@ -586,7 +588,7 @@ impl Html {
586
588
587
589
fn generate_summary (
588
590
& self ,
589
- group_id : & str ,
591
+ id : & BenchmarkId ,
590
592
data : & [ & ( BenchmarkId , Vec < f64 > ) ] ,
591
593
report_context : & ReportContext ,
592
594
full_summary : bool ,
@@ -596,17 +598,19 @@ impl Html {
596
598
try_else_return ! (
597
599
fs:: mkdirp( & format!(
598
600
"{}/{}/report/" ,
599
- report_context. output_directory, group_id
601
+ report_context. output_directory,
602
+ id. as_directory_name( )
600
603
) ) ,
601
604
|| gnuplots
602
605
) ;
603
606
604
607
let violin_path = format ! (
605
608
"{}/{}/report/violin.svg" ,
606
- report_context. output_directory, group_id
609
+ report_context. output_directory,
610
+ id. as_directory_name( )
607
611
) ;
608
612
gnuplots. push ( plot:: summary:: violin (
609
- group_id ,
613
+ id . id ( ) ,
610
614
data,
611
615
& violin_path,
612
616
report_context. plot_config . summary_scale ,
@@ -622,11 +626,12 @@ impl Html {
622
626
if let Some ( value_type) = value_types[ 0 ] {
623
627
let path = format ! (
624
628
"{}/{}/report/lines.svg" ,
625
- report_context. output_directory, group_id
629
+ report_context. output_directory,
630
+ id. as_directory_name( )
626
631
) ;
627
632
628
633
gnuplots. push ( plot:: summary:: line_comparison (
629
- group_id ,
634
+ id . id ( ) ,
630
635
data,
631
636
& path,
632
637
value_type,
@@ -643,7 +648,7 @@ impl Html {
643
648
. collect ( ) ;
644
649
645
650
let context = SummaryContext {
646
- group_id : group_id . to_owned ( ) ,
651
+ group_id : id . id ( ) . to_owned ( ) ,
647
652
648
653
thumbnail_width : THUMBNAIL_SIZE . 0 ,
649
654
thumbnail_height : THUMBNAIL_SIZE . 1 ,
@@ -662,7 +667,8 @@ impl Html {
662
667
& text,
663
668
& format!(
664
669
"{}/{}/report/index.html" ,
665
- report_context. output_directory, group_id
670
+ report_context. output_directory,
671
+ id. as_directory_name( )
666
672
) ,
667
673
) ,
668
674
|| gnuplots
0 commit comments