aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2025-03-05 10:15:46 +0000
committerdanielhanrahan <daniel.hanrahan@est.tech>2025-03-06 16:34:37 +0000
commita5d5489b97e1da2ecfb72b5180d5a176e2345f05 (patch)
treeaea8fcd94db21c35d5a92e3a8a3072ec7fcb474e
parent1337752d3175309a66a50fe04aa9b289a33e4290 (diff)
Fix test-tools metrics script
The test script for generating spreadsheet report from prometheus metrics is currently broken (produces garbage output). - Issue is fixed by specifying space character as delimiter. - Add more metrics to the report to make script more useful. Issue-ID: CPS-2651 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I6347521f15bdfc1654243552bfe87190058bd8db
-rwxr-xr-xtest-tools/generate-metrics-report.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/test-tools/generate-metrics-report.sh b/test-tools/generate-metrics-report.sh
index 7d94e5b49f..4d99adfdff 100755
--- a/test-tools/generate-metrics-report.sh
+++ b/test-tools/generate-metrics-report.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright 2023 Nordix Foundation.
+# Copyright 2023-2025 Nordix Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -75,13 +75,13 @@ function generate_report() {
grep --invert-match "^#" $TEMP_DIR/metrics-raw.txt | sort | sed 's/,[}]/}\t/' >$TEMP_DIR/metrics-all.txt
# Extract useful metrics.
- grep -E "^cps_|^spring_data_" $TEMP_DIR/metrics-all.txt >$TEMP_DIR/metrics-cps.txt
+ grep -E "^cps_|^spring_data_|^http_server_|^http_client_|^tasks_scheduled_execution_|^spring_kafka_template_|^spring_kafka_listener_" $TEMP_DIR/metrics-all.txt >$TEMP_DIR/metrics-cps.txt
# Extract into columns.
- grep "_count" $TEMP_DIR/metrics-cps.txt | sed 's/_count//' | cut -f 1 >$TEMP_DIR/column1.txt
- grep "_count" $TEMP_DIR/metrics-cps.txt | cut -f 2 >$TEMP_DIR/column2.txt
- grep "_sum" $TEMP_DIR/metrics-cps.txt | cut -f 2 >$TEMP_DIR/column3.txt
- grep "_max" $TEMP_DIR/metrics-cps.txt | cut -f 2 >$TEMP_DIR/column4.txt
+ grep "_count" $TEMP_DIR/metrics-cps.txt | sed 's/_count//' | cut -d ' ' -f 1 >$TEMP_DIR/column1.txt
+ grep "_count" $TEMP_DIR/metrics-cps.txt | cut -d ' ' -f 2 >$TEMP_DIR/column2.txt
+ grep "_sum" $TEMP_DIR/metrics-cps.txt | cut -d ' ' -f 2 >$TEMP_DIR/column3.txt
+ grep "_max" $TEMP_DIR/metrics-cps.txt | cut -d ' ' -f 2 >$TEMP_DIR/column4.txt
# Combine columns into report.
paste $TEMP_DIR/column{1,2,3,4}.txt >$TEMP_DIR/report.txt