Skip to content

Commit a6d10f5

Browse files
authored
DEVPROD-17574 - Replace perf.send with new data submission end point (#1006)
1 parent 69e47f1 commit a6d10f5

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

.evergreen/config.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,9 +1065,38 @@ tasks:
10651065
working_dir: "./libmongocrypt"
10661066
args:
10671067
- "./.evergreen/benchmark-python.sh"
1068-
- command: "perf.send"
1068+
- command: shell.exec
10691069
params:
1070-
file: libmongocrypt/bindings/python/results.json
1070+
script: |
1071+
# We use the requester expansion to determine whether the data is from a mainline evergreen run or not
1072+
if [ "${requester}" == "commit" ]; then
1073+
is_mainline=true
1074+
else
1075+
is_mainline=false
1076+
fi
1077+
1078+
# Parse the username out of the order_id. Patches append the username. The Signal Processing Service (SPS) endpoint does not need the other information.
1079+
parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')
1080+
1081+
# Submit the performance data to the SPS endpoint
1082+
response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
1083+
"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" \
1084+
-H 'accept: application/json' \
1085+
-H 'Content-Type: application/json' \
1086+
-d @libmongocrypt/bindings/python/results.json)
1087+
1088+
http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
1089+
response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
1090+
1091+
# We want to throw an error if the data was not successfully submitted
1092+
if [ "$http_status" -ne 200 ]; then
1093+
echo "Error: Received HTTP status $http_status"
1094+
echo "Response Body: $response_body"
1095+
exit 1
1096+
fi
1097+
1098+
echo "Response Body: $response_body"
1099+
echo "HTTP Status: $http_status"
10711100
10721101
- name: sbom
10731102
commands:

0 commit comments

Comments
 (0)