[Why]
if stddev < 1% | == 0
We display nothing for stddev column like bellow, it may confuse user.
0 1 metric
-------------------- ------------------------------ ------------------------------
%stddev change %stddev
\ | \
276589.17 -5.2% 262249.03 redis.get_avg_throughput_rps
61.47 +5.5% 64.83 redis.get_avg_time_sec
58.33 ± 53% -100.0% 0.00 redis.get_latency_0ms%
[How]
0 1 metric
-------------------- ------------------------------ ------------------------------
%stddev change %stddev
\ | \
276589.17 < 1% -5.2% 262249.03 < 1% redis.get_avg_throughput_rps
61.47 < 1% +5.5% 64.83 < 1% redis.get_avg_time_sec
58.33 ± 53% -100.0% 0.00 redis.get_latency_0ms%
Signed-off-by: Lu Weitao <luweitaobe(a)163.com>
---
lib/compare_matrixes.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/compare_matrixes.rb b/lib/compare_matrixes.rb
index 7760c93..6c88384 100644
--- a/lib/compare_matrixes.rb
+++ b/lib/compare_matrixes.rb
@@ -72,7 +72,7 @@ def get_values(value_list, success)
if length > 1 && average != 0
stddev_percent = (
standard_deviation(value_list, average, length) * 100 / average
- ).to_i
+ )
end
{ average: average, stddev_percent: stddev_percent,
min: sorted[0], max: sorted[-1], sorted: sorted }
@@ -204,7 +204,7 @@ def matrixes_empty?(matrixes_list)
return matrixes_list.any?(&:empty?)
end
-def compare_matrixes(matrixes_list, suite_list, latest_jobs = nil, matrixes_titles = nil, group_key = nil, options: {})
+def compare_matrixes(matrixes_list, suite_list, latest_jobs=nil, matrixes_titles = nil, group_key = nil, options: {})
# compare matrix in matrixes_list and print info
# @matrixes_list: list consisting of matrix
# @matrixes_titles: number or dimension of matrix
@@ -615,6 +615,8 @@ def format_stddev_percent(stddev_percent, average_width)
percent_width = SUB_LONG_COLUMN_WIDTH - average_width
if stddev_percent
if stddev_percent != 0
+ return " < 1% " if stddev_percent < 1
+
percent_str = get_suitable_number_str(
stddev_percent.abs,
percent_width - 4,
--
2.23.0