Skip to content

Commit 6b3835c

Browse files
authored
DEVPROD-17449: Replace perf.send with new direct end point for performance data submission (#1689)
1 parent 919fceb commit 6b3835c

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

evergreen/evergreen.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,39 @@ functions:
476476
script: |
477477
${PREPARE_SHELL}
478478
MONGODB_URI="${MONGODB_URI}" ../../evergreen/run-perf-tests.sh
479-
- command: perf.send
479+
- command: shell.exec
480480
params:
481-
file: mongo-csharp-driver/benchmarks/MongoDB.Driver.Benchmarks/Benchmark.Artifacts/results/evergreen-results.json
481+
script: |
482+
# We use the requester expansion to determine whether the data is from a mainline evergreen run or not
483+
if [ "${requester}" == "commit" ]; then
484+
is_mainline=true
485+
else
486+
is_mainline=false
487+
fi
488+
489+
# We parse the username out of the order_id as patches append that in and SPS does not need that information
490+
parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')
491+
492+
# Submit the performance data to the SPS endpoint
493+
response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
494+
"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" \
495+
-H 'accept: application/json' \
496+
-H 'Content-Type: application/json' \
497+
-d @mongo-csharp-driver/benchmarks/MongoDB.Driver.Benchmarks/Benchmark.Artifacts/results/evergreen-results.json)
498+
499+
http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
500+
response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
501+
502+
# We want to throw an error if the data was not successfully submitted
503+
if [ "$http_status" -ne 200 ]; then
504+
echo "Error: Received HTTP status $http_status"
505+
echo "Response Body: $response_body"
506+
exit 1
507+
fi
482508
509+
echo "Response Body: $response_body"
510+
echo "HTTP Status: $http_status"
511+
483512
assume-ec2-role:
484513
- command: ec2.assume_role
485514
params:

0 commit comments

Comments
 (0)