@@ -107,7 +107,7 @@ fn html_of_fraction(frac: f64) -> (String, String) {
107
107
else { ( format ! ( "< 0.1%" , ) , css) }
108
108
}
109
109
110
- fn total_duration ( traces : & Vec < Rec > ) -> Duration {
110
+ fn total_duration ( traces : & [ Rec ] ) -> Duration {
111
111
let mut sum : Duration = Duration :: new ( 0 , 0 ) ;
112
112
for t in traces. iter ( ) {
113
113
sum += t. dur_total ;
@@ -123,7 +123,7 @@ fn duration_div(nom: Duration, den: Duration) -> f64 {
123
123
to_nanos ( nom) as f64 / to_nanos ( den) as f64
124
124
}
125
125
126
- fn write_traces_rec ( file : & mut File , traces : & Vec < Rec > , total : Duration , depth : usize ) {
126
+ fn write_traces_rec ( file : & mut File , traces : & [ Rec ] , total : Duration , depth : usize ) {
127
127
for t in traces {
128
128
let ( eff_text, eff_css_classes) = html_of_effect ( & t. effect ) ;
129
129
let ( dur_text, dur_css_classes) = html_of_duration ( & t. start , & t. dur_total ) ;
@@ -149,7 +149,7 @@ fn write_traces_rec(file: &mut File, traces: &Vec<Rec>, total: Duration, depth:
149
149
}
150
150
}
151
151
152
- fn compute_counts_rec ( counts : & mut HashMap < String , QueryMetric > , traces : & Vec < Rec > ) {
152
+ fn compute_counts_rec ( counts : & mut HashMap < String , QueryMetric > , traces : & [ Rec ] ) {
153
153
for t in traces. iter ( ) {
154
154
match t. effect {
155
155
Effect :: TimeBegin ( ref msg) => {
@@ -218,7 +218,7 @@ pub fn write_counts(count_file: &mut File, counts: &mut HashMap<String,QueryMetr
218
218
}
219
219
}
220
220
221
- pub fn write_traces ( html_file : & mut File , counts_file : & mut File , traces : & Vec < Rec > ) {
221
+ pub fn write_traces ( html_file : & mut File , counts_file : & mut File , traces : & [ Rec ] ) {
222
222
let capacity = traces. iter ( ) . fold ( 0 , |acc, t| acc + 1 + t. extent . len ( ) ) ;
223
223
let mut counts : HashMap < String , QueryMetric > = HashMap :: with_capacity ( capacity) ;
224
224
compute_counts_rec ( & mut counts, traces) ;
0 commit comments