only aggregate stats if there's more than one request
@@ -74,6 +74,7 @@ fn print_requests_and_fails(requests: &HashMap<String, GooseRequest>, elapsed: u
aggregate_total_count += total_count;
aggregate_fail_count += request.fail_count;
}
+ if requests.len() > 1 {
let aggregate_fail_percent: f32;
if aggregate_fail_count > 0 {
aggregate_fail_percent = aggregate_fail_count as f32 / aggregate_total_count as f32 * 100.0;
@@ -102,6 +103,7 @@ fn print_requests_and_fails(requests: &HashMap<String, GooseRequest>, elapsed: u
);
}
}
+}
fn print_response_times(requests: &HashMap<String, GooseRequest>, display_percentiles: bool) {
let mut aggregate_response_times: BTreeMap<usize, usize> = BTreeMap::new();
@@ -139,6 +141,7 @@ fn print_response_times(requests: &HashMap<String, GooseRequest>, display_percen
util::median(&request.response_times, request.response_time_counter, request.min_response_time, request.max_response_time),
);
}
+ if requests.len() > 1 {
println!(" ------------------------+------------+------------+------------+------------- ");
if aggregate_response_time_counter == 0 {
aggregate_response_time_counter = 1;
@@ -150,6 +153,7 @@ fn print_response_times(requests: &HashMap<String, GooseRequest>, display_percen
aggregate_max_response_time,
util::median(&aggregate_response_times, aggregate_response_time_counter, aggregate_min_response_time, aggregate_max_response_time),
);
+ }
if display_percentiles {
println!("-------------------------------------------------------------------------------");
@@ -170,6 +174,7 @@ fn print_response_times(requests: &HashMap<String, GooseRequest>, display_percen
calculate_response_time_percentile(&request.response_times, request.response_time_counter, request.min_response_time, request.max_response_time, 0.999),
);
}
+ if requests.len() > 1 {
println!(" ------------------------+--------+--------+--------+--------+--------+------- ");
println!(" {:<23} | {:<6.2} | {:<6.2} | {:<6.2} | {:<6.2} | {:<6.2} | {:6.2}",
"Aggregated",
@@ -182,6 +187,7 @@ fn print_response_times(requests: &HashMap<String, GooseRequest>, display_percen
);
}
}
+}
fn print_status_codes(requests: &HashMap<String, GooseRequest>) {
println!("-------------------------------------------------------------------------------");
