@@ -233,9 +233,38 @@ functions:
233233 args : [*task-runner, pr-task]
234234
235235 send-perf-data :
236- - command : perf.send
237- params :
238- file : src/go.mongodb.org/mongo-driver/perf.json
236+ # Here we begin to generate the request to send the data to SPS
237+ - command : shell.exec
238+ params :
239+ script : |
240+ # We use the requester expansion to determine whether the data is from a mainline evergreen run or not
241+ if [ "${requester}" == "commit" ]; then
242+ is_mainline=true
243+ else
244+ is_mainline=false
245+ fi
246+
247+ # We parse the username out of the order_id as patches append that in and SPS does not need that information
248+ parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')
249+ # Submit the performance data to the SPS endpoint
250+ response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
251+ "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" \
252+ -H 'accept: application/json' \
253+ -H 'Content-Type: application/json' \
254+ -d @src/go.mongodb.org/mongo-driver/perf.json)
255+
256+ http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
257+ response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
258+
259+ # We want to throw an error if the data was not successfully submitted
260+ if [ "$http_status" -ne 200 ]; then
261+ echo "Error: Received HTTP status $http_status"
262+ echo "Response Body: $response_body"
263+ exit 1
264+ fi
265+
266+ echo "Response Body: $response_body"
267+ echo "HTTP Status: $http_status"
239268
240269 run-enterprise-auth-tests :
241270 - command : ec2.assume_role
0 commit comments