@@ -155,7 +155,7 @@ pub async fn handle_self_profile_processed_download(
155
155
}
156
156
157
157
fn get_self_profile_data (
158
- cpu_clock : Option < f64 > ,
158
+ total_instructions : Option < f64 > ,
159
159
profile : & analyzeme:: AnalysisResults ,
160
160
) -> ServerResult < self_profile:: SelfProfile > {
161
161
let total_time: Duration = profile. query_data . iter ( ) . map ( |qd| qd. self_time ) . sum ( ) ;
@@ -180,7 +180,7 @@ fn get_self_profile_data(
180
180
label : "Totals" . into ( ) ,
181
181
self_time : total_time. as_nanos ( ) as u64 ,
182
182
// TODO: check against wall-time from perf stats
183
- percent_total_time : cpu_clock
183
+ percent_total_time : total_instructions
184
184
. map ( |w| ( ( total_time. as_secs_f64 ( ) / w) * 100.0 ) as f32 )
185
185
// sentinel "we couldn't compute this time"
186
186
. unwrap_or ( -100.0 ) ,
@@ -602,9 +602,9 @@ pub async fn handle_self_profile(
602
602
}
603
603
let commits = Arc :: new ( commits) ;
604
604
605
- let mut cpu_responses = ctxt. statistic_series ( query, commits. clone ( ) ) . await ?;
606
- assert_eq ! ( cpu_responses . len( ) , 1 , "all selectors are exact" ) ;
607
- let mut cpu_response = cpu_responses . remove ( 0 ) . series ;
605
+ let mut instructions_responses = ctxt. statistic_series ( query, commits. clone ( ) ) . await ?;
606
+ assert_eq ! ( instructions_responses . len( ) , 1 , "all selectors are exact" ) ;
607
+ let mut instructions_response = instructions_responses . remove ( 0 ) . series ;
608
608
609
609
let mut self_profile_data = Vec :: new ( ) ;
610
610
let conn = ctxt. conn ( ) . await ;
@@ -623,12 +623,16 @@ pub async fn handle_self_profile(
623
623
}
624
624
}
625
625
let profiling_data = self_profile_data. remove ( 0 ) . perform_analysis ( ) ;
626
- let mut profile = get_self_profile_data ( cpu_response. next ( ) . unwrap ( ) . 1 , & profiling_data)
627
- . map_err ( |e| format ! ( "{}: {}" , body. commit, e) ) ?;
626
+ let mut profile =
627
+ get_self_profile_data ( instructions_response. next ( ) . unwrap ( ) . 1 , & profiling_data)
628
+ . map_err ( |e| format ! ( "{}: {}" , body. commit, e) ) ?;
628
629
let ( base_profile, base_raw_data) = if body. base_commit . is_some ( ) {
629
630
let base_profiling_data = self_profile_data. remove ( 0 ) . perform_analysis ( ) ;
630
- let profile = get_self_profile_data ( cpu_response. next ( ) . unwrap ( ) . 1 , & base_profiling_data)
631
- . map_err ( |e| format ! ( "{}: {}" , body. base_commit. as_ref( ) . unwrap( ) , e) ) ?;
631
+ let profile = get_self_profile_data (
632
+ instructions_response. next ( ) . unwrap ( ) . 1 ,
633
+ & base_profiling_data,
634
+ )
635
+ . map_err ( |e| format ! ( "{}: {}" , body. base_commit. as_ref( ) . unwrap( ) , e) ) ?;
632
636
( Some ( profile) , Some ( base_profiling_data) )
633
637
} else {
634
638
( None , None )
0 commit comments