From 16e31dd40946c31f7d7f7764c6c64fe180b1ba9e Mon Sep 17 00:00:00 2001 From: David Esparza Date: Tue, 3 Oct 2023 23:33:19 -0600 Subject: [PATCH] metrics: Use jq tool to pretty-print json metrics output This PR enables the use of jq pretty-print feature to improve the formatting of metric results json files. Fixes: #8081 Signed-off-by: David Esparza (cherry picked from commit 8c498ef5eecc9155b7e19233499a9d5306f3dffa) --- tests/metrics/lib/json.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/metrics/lib/json.bash b/tests/metrics/lib/json.bash index 017d6494a2..1a30820950 100755 --- a/tests/metrics/lib/json.bash +++ b/tests/metrics/lib/json.bash @@ -147,7 +147,7 @@ done) EOF )" - echo "$json" > $json_filename + echo "${json}" | jq . > "${json_filename}" # If we have a JSON URL or host/socket pair set up, post the results there as well. # Optionally compress into a single line.