From 71ed5c722720d081f206dfd0f549dc988742068e Mon Sep 17 00:00:00 2001 From: 20urc3 <94982366+20urc3@users.noreply.github.com> Date: Fri, 13 Sep 2024 21:03:18 +0200 Subject: [PATCH] Update how exec/sec is displayed (#2524) - Only display 1 digit after . for value above 1k - Only display 2 digits after . for value above 1m 3.254k exec/sec becomes => 3.2k exec/sec 3.254M exec/sec becomes => 3.25M exec/sec --- libafl/src/monitors/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libafl/src/monitors/mod.rs b/libafl/src/monitors/mod.rs index 9a4ede5348..ed8457b161 100644 --- a/libafl/src/monitors/mod.rs +++ b/libafl/src/monitors/mod.rs @@ -318,8 +318,11 @@ fn prettify_float(value: f64) -> String { value => (value, ""), }; match value { + value if value >= 1000000.0 => { + format!("{value:.2}{suffix}") + } value if value >= 1000.0 => { - format!("{value}{suffix}") + format!("{value:.1}{suffix}") } value if value >= 100.0 => { format!("{value:.1}{suffix}")