Skip to content

Commit 38d9116

Browse files
authored
fix(ci): replace perf.send command with new API end point for performance data submission DEVPROD-19866 (#2510)
1 parent 100b1dd commit 38d9116

File tree

2 files changed

+62
-4
lines changed

2 files changed

+62
-4
lines changed

.evergreen.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4402,9 +4402,38 @@ functions:
44024402
sh -c 'MONGOSH_SMOKE_TEST_SERVER="$MONGODB_URI" ./dist/mongosh --perfTests > perf_results.json'
44034403
env:
44044404
DISTRO_ID: ${distro_id}
4405-
- command: perf.send
4405+
- command: shell.exec
44064406
params:
4407-
file: src/perf_results.json
4407+
script: |
4408+
# We use the requester expansion to determine whether the data is from a mainline evergreen run or not
4409+
if [ "${requester}" == "commit" ]; then
4410+
is_mainline=true
4411+
else
4412+
is_mainline=false
4413+
fi
4414+
4415+
# Parse the username out of the order_id. Patches append the username. The Signal Processing Service (SPS) endpoint does not need the other information.
4416+
parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')
4417+
4418+
# Submit the performance data to the SPS endpoint
4419+
response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
4420+
"https://performance-monitoring-api.corp.mongodb.com/raw_perf_results/cedar_report?project=${project_id}&version=${version_id}&variant=${build_variant}&order=$parsed_order_id&task_name=${task_name}&task_id=${task_id}&execution=${execution}&mainline=$is_mainline" \
4421+
-H 'accept: application/json' \
4422+
-H 'Content-Type: application/json' \
4423+
-d @src/perf_results.json)
4424+
4425+
http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
4426+
response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
4427+
4428+
# We want to throw an error if the data was not successfully submitted
4429+
if [ "$http_status" -ne 200 ]; then
4430+
echo "Error: Received HTTP status $http_status"
4431+
echo "Response Body: $response_body"
4432+
exit 1
4433+
fi
4434+
4435+
echo "Response Body: $response_body"
4436+
echo "HTTP Status: $http_status"
44084437
44094438
# Tasks will show up as the individual blocks in the Evergreen UI that can
44104439
# pass or fail.

.evergreen/evergreen.yml.in

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,39 @@ functions:
10471047
sh -c 'MONGOSH_SMOKE_TEST_SERVER="$MONGODB_URI" ./dist/mongosh --perfTests > perf_results.json'
10481048
env:
10491049
DISTRO_ID: ${distro_id}
1050-
- command: perf.send
1050+
- command: shell.exec
10511051
params:
1052-
file: src/perf_results.json
1052+
script: |
1053+
# We use the requester expansion to determine whether the data is from a mainline evergreen run or not
1054+
if [ "${requester}" == "commit" ]; then
1055+
is_mainline=true
1056+
else
1057+
is_mainline=false
1058+
fi
1059+
1060+
# Parse the username out of the order_id. Patches append the username. The Signal Processing Service (SPS) endpoint does not need the other information.
1061+
parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')
1062+
1063+
# Submit the performance data to the SPS endpoint
1064+
response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
1065+
"https://performance-monitoring-api.corp.mongodb.com/raw_perf_results/cedar_report?project=${project_id}&version=${version_id}&variant=${build_variant}&order=$parsed_order_id&task_name=${task_name}&task_id=${task_id}&execution=${execution}&mainline=$is_mainline" \
1066+
-H 'accept: application/json' \
1067+
-H 'Content-Type: application/json' \
1068+
-d @src/perf_results.json)
1069+
1070+
http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
1071+
response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
1072+
1073+
# We want to throw an error if the data was not successfully submitted
1074+
if [ "$http_status" -ne 200 ]; then
1075+
echo "Error: Received HTTP status $http_status"
1076+
echo "Response Body: $response_body"
1077+
exit 1
1078+
fi
10531079

1080+
echo "Response Body: $response_body"
1081+
echo "HTTP Status: $http_status"
1082+
10541083
# Tasks will show up as the individual blocks in the Evergreen UI that can
10551084
# pass or fail.
10561085
#

0 commit comments

Comments
 (0)