Skip to content

DEVPROD-17371 - Replace perf.send with direct data submission to new end point #1370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions .evergreen/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,39 @@ functions:
display_name: "mongodb-logs.tar.gz"

"upload benchmark results":
- command: perf.send
- command: shell.exec
params:
file: "src/benchmark-results.json"
script: |
# We use the requester expansion to determine whether the data is from a mainline evergreen run or not
if [ "${requester}" == "commit" ]; then
is_mainline=true
else
is_mainline=false
fi

parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')

ENCODED_URL=$(echo "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" | sed -e 's/ /%20/g')
Copy link
Contributor Author

@MAhmadShah MAhmadShah May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your variant name has a space in it, hence we need to encode the URL


# Submit the performance data to the SPS endpoint
response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
"$ENCODED_URL" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d @src/benchmark-results.json)

http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
response_body=$(echo "$response" | sed '/HTTP_STATUS/d')

# We want to throw an error if the data was not successfully submitted
if [ "$http_status" -ne 200 ]; then
echo "Error: Received HTTP status $http_status"
echo "Response Body: $response_body"
exit 1
fi

echo "Response Body: $response_body"
echo "HTTP Status: $http_status"

"stop mongo orchestration":
- command: shell.exec
Expand Down