Skip to content

Commit 2e28643

Browse files
authored
Use benchmark stop time as results directory timestamp to ensure accurate naming (#489)
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
1 parent 723f7cf commit 2e28643

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

scripts/perf-lab/push-results.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ sanitize_results() {
5151
}
5252

5353
push_results() {
54+
# Compute the results directory timestamp from the benchmark's actual stop time
55+
currentDateTime=$(jq -r '.timing.stop' "${RUN_RESULTS_DIR}/metrics.json")
56+
resultsDir="${jobResultsDir}/${currentDateTime}"
57+
5458
# Setup GH cli
5559
gh auth login --with-token <<< "${GITHUB_TOKEN}"
5660

@@ -69,6 +73,7 @@ push_results() {
6973
git checkout -b ${branchName}
7074

7175
# Copy over the results into a new directory named with the current date/time
76+
echo "Creating results directory ${resultsDir}"
7277
mkdir -p ${resultsDir}
7378

7479
cp -R ${RUN_RESULTS_DIR}/* ${resultsDir}/
@@ -110,7 +115,9 @@ push_results() {
110115
gh pr create \
111116
-l perf-lab-run \
112117
-t "Adding results from perf lab run ${jobName}.${currentDateTime}" \
113-
-b "This PR was automatically created to add the results from the perf lab run ${jobName}.${currentDateTime}.\n\n${DESCRIPTION}" \
118+
-b "This PR was automatically created to add the results from the perf lab run ${jobName}.${currentDateTime}.
119+
120+
${DESCRIPTION}" \
114121
-B main
115122

116123
# Log out GH CLI
@@ -121,11 +128,9 @@ push_results() {
121128
RUN_RESULTS_DIR=""
122129
GITHUB_TOKEN=""
123130
DESCRIPTION=""
124-
currentDateTime=$(date +%Y-%m-%d_%H-%M-%S)
125-
branchName="upload-results-${currentDateTime}"
131+
branchName="upload-results-$(date +%Y-%m-%d_%H-%M-%S)"
126132
jobName="spring-quarkus-perf-comparison"
127133
jobResultsDir="results/${jobName}"
128-
resultsDir="${jobResultsDir}/${currentDateTime}"
129134

130135
# Process the inputs
131136
while getopts "d:r:t:" option; do

0 commit comments

Comments
 (0)