Skip to content

Commit 3cb052e

Browse files
DEVPROD-20053 - Remove perf.send from latest release branch (#1433)
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
1 parent 8cbc4b3 commit 3cb052e

File tree

3 files changed

+60
-11
lines changed

3 files changed

+60
-11
lines changed

.evergreen/config_generator/components/benchmarks.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,21 @@ class RunBenchmarks(Function):
2626
working_dir='mongo-cxx-driver',
2727
script='build/benchmark/microbenchmarks all',
2828
),
29-
30-
BuiltInCommand(
31-
command='perf.send',
32-
type=EvgCommandType.SYSTEM,
33-
params={
34-
'name': 'perf',
35-
'file': 'mongo-cxx-driver/results.json',
36-
}
29+
bash_exec(
30+
command_type=EvgCommandType.SYSTEM,
31+
working_dir='mongo-cxx-driver',
32+
script='.evergreen/scripts/send-perf-data.sh',
33+
include_expansions_in_env=[
34+
'build_variant',
35+
'execution',
36+
'parsed_order_id',
37+
'project_id',
38+
'requester',
39+
'revision_order_id',
40+
'task_id',
41+
'task_name',
42+
'version_id',
43+
],
3744
),
3845
]
3946

.evergreen/generated_configs/functions.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,23 @@ functions:
142142
args:
143143
- -c
144144
- build/benchmark/microbenchmarks all
145-
- command: perf.send
145+
- command: subprocess.exec
146146
type: system
147147
params:
148-
name: perf
149-
file: mongo-cxx-driver/results.json
148+
binary: bash
149+
working_dir: mongo-cxx-driver
150+
include_expansions_in_env:
151+
- project_id
152+
- version_id
153+
- build_variant
154+
- task_name
155+
- task_id
156+
- execution
157+
- requester
158+
- revision_order_id
159+
args:
160+
- -c
161+
- .evergreen/scripts/send-perf-data.sh
150162
build-package-debian:
151163
- command: subprocess.exec
152164
type: test
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o pipefail
5+
6+
# We use the requester expansion to determine whether the data is from a mainline evergreen run or not
7+
if [ "${requester:?}" == "commit" ]; then
8+
is_mainline=true
9+
else
10+
is_mainline=false
11+
fi
12+
13+
# Parse the username out of the order_id. Patches append the username. The raw perf results end point does not need the other information.
14+
parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')
15+
16+
response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
17+
"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}" \
18+
-H 'accept: application/json' \
19+
-H 'Content-Type: application/json' \
20+
-d @results.json)
21+
http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
22+
response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
23+
# We want to throw an error if the data was not successfully submitted
24+
[[ "${http_status:?}" -eq 200 ]] || {
25+
echo "Error: Received HTTP status $http_status"
26+
echo "Response Body: $response_body"
27+
exit 1
28+
} >&2
29+
echo "Response Body: $response_body"
30+
echo "HTTP Status: $http_status"

0 commit comments

Comments
 (0)