Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dev-sandbox): generate a single CSV file with all the collected metrics #142

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"