Skip to content

Commit

Permalink
feat(dev-sandbox): generate a single CSV file with all the collected …
Browse files Browse the repository at this point in the history
…metrics. (#142)

Signed-off-by: Pavel Macík <[email protected]>
  • Loading branch information
pmacik authored Dec 19, 2024
1 parent 242f905 commit 2062122
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ci-scripts/dev-sandbox/collect-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mkdir -p "${TMP_DIR}"

cli="oc"

out=$ARTIFACT_DIR/dev-sandbox/summary.csv
out=$ARTIFACT_DIR/summary.csv
rm -rvf "$out"
while read -r baseline_csv; do
while read -r metrics; do
Expand Down Expand Up @@ -59,6 +59,7 @@ source "$PYTHON_VENV_DIR/bin/activate"
set -u
python3 -m pip install --quiet -U pip
python3 -m pip install --quiet -e "git+https://github.com/redhat-performance/opl.git#egg=opl-rhcloud-perf-team-core&subdirectory=core"
python3 -m pip install --quiet -U csvkit
set +u
deactivate
set -u
Expand Down Expand Up @@ -103,13 +104,15 @@ while read -r metric_csv; do
timestamp="${tokens[0]}"
value="${tokens[1]}"
if [[ $line =~ ^timestamp ]]; then
echo "$line"
echo "$timestamp;$value"
else
echo "$(date -d "@$timestamp" --utc -Ins),$value"
echo "$(date -d "@$timestamp" --utc "+%F %T");$value"
fi
done <"$tmp_csv" >>"$metric_csv"
rm -f "$tmp_csv"
} &
done <<<"$(find "$monitoring_collection_dir" -name '*.csv')"

wait

csvjoin -c timestamp -d ";" --datetime-format "%F %T" "$monitoring_collection_dir"/*.csv >"$ARTIFACT_DIR/metrics-all.csv"

0 comments on commit 2062122

Please sign in to comment.