File tree 1 file changed +31
-2
lines changed
1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -377,9 +377,38 @@ functions:
377
377
script : |
378
378
${PREPARE_SHELL}
379
379
TEST_CMD="bundle exec rake driver_bench" PERFORMANCE_RESULTS_FILE="$PROJECT_DIRECTORY/perf.json" .evergreen/run-tests.sh
380
- - command : perf.send
380
+ - command : shell.exec
381
381
params :
382
- file : " ${PROJECT_DIRECTORY}/perf.json"
382
+ script : |
383
+ # We use the requester expansion to determine whether the data is from a mainline evergreen run or not
384
+ if [ "${requester}" == "commit" ]; then
385
+ is_mainline=true
386
+ else
387
+ is_mainline=false
388
+ fi
389
+
390
+ # We parse the username out of the order_id as patches append that in and SPS does not need that information
391
+ parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')
392
+
393
+ # Submit the performance data to the SPS endpoint
394
+ response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
395
+ "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" \
396
+ -H 'accept: application/json' \
397
+ -H 'Content-Type: application/json' \
398
+ -d @${PROJECT_DIRECTORY}/perf.json)
399
+
400
+ http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
401
+ response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
402
+
403
+ # We want to throw an error if the data was not successfully submitted
404
+ if [ "$http_status" -ne 200 ]; then
405
+ echo "Error: Received HTTP status $http_status"
406
+ echo "Response Body: $response_body"
407
+ exit 1
408
+ fi
409
+
410
+ echo "Response Body: $response_body"
411
+ echo "HTTP Status: $http_status"
383
412
384
413
" run tests " :
385
414
- command : shell.exec
You can’t perform that action at this time.
0 commit comments