Skip to content

DEVPROD-17369 - Update generated config to use new data send script to replace perf.send #1398

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 2 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
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
13 changes: 5 additions & 8 deletions .evergreen/config_generator/components/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ class RunBenchmarks(Function):
working_dir='mongo-cxx-driver',
script='build/benchmark/microbenchmarks all',
),

BuiltInCommand(
command='perf.send',
type=EvgCommandType.SYSTEM,
params={
'name': 'perf',
'file': 'mongo-cxx-driver/results.json',
}
bash_exec(
command_type=EvgCommandType.SYSTEM,
working_dir='mongo-cxx-driver',
script='.evergreen/scripts/send-perf-data.sh',
include_expansions_in_env=['project_id', 'version_id', 'build_variant', 'parsed_order_id', 'task_name', 'task_id', 'execution', 'requester', 'revision_order_id'],
),
]

Expand Down
19 changes: 16 additions & 3 deletions .evergreen/generated_configs/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,24 @@ functions:
args:
- -c
- build/benchmark/microbenchmarks all
- command: perf.send
- command: subprocess.exec
type: system
params:
name: perf
file: mongo-cxx-driver/results.json
binary: bash
working_dir: mongo-cxx-driver
include_expansions_in_env:
- project_id
- version_id
- build_variant
- parsed_order_id
- task_name
- task_id
- execution
- requester
- revision_order_id
args:
- -c
- .evergreen/scripts/send-perf-data.sh
build-package-debian:
- command: subprocess.exec
type: test
Expand Down
30 changes: 30 additions & 0 deletions .evergreen/scripts/send-perf-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

set -o errexit
set -o pipefail

# 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

# Parse the username out of the order_id. Patches append the username. The raw perf results end point does not need the other information.
parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')

response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
"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}" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d @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"