Skip to content

Commit fa70282

Browse files
authored
DEVPROD-17323 Replace perf.send with new data submission end point (#2003)
1 parent 24ed3a0 commit fa70282

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

.evergreen/benchmark.yml

+38-4
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,44 @@ functions:
170170
file_location: mongo-c-driver/report.json
171171

172172
"send dashboard data" :
173-
command: perf.send
174-
params:
175-
name: perf
176-
file: mongo-c-driver/results.json
173+
# Here we begin to generate the request to send the data to Signal Processing Service (SPS)
174+
- command: shell.exec
175+
params:
176+
script: |
177+
# We use the requester expansion to determine whether the data is from a mainline evergreen run or not
178+
if [ "${requester}" == "commit" ]; then
179+
echo "is_mainline: true" >> expansion.yml
180+
else
181+
echo "is_mainline: false" >> expansion.yml
182+
fi
183+
184+
# We parse the username out of the order_id as patches append that in and SPS does not need that information
185+
echo "parsed_order_id: $(echo "${revision_order_id}" | awk -F'_' '{print $NF}')" >> expansion.yml
186+
- command: expansions.update
187+
params:
188+
file: expansion.yml
189+
- command: shell.exec
190+
params:
191+
script: |
192+
# Submit the performance data to the SPS endpoint
193+
response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
194+
"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}" \
195+
-H 'accept: application/json' \
196+
-H 'Content-Type: application/json' \
197+
-d @mongo-c-driver/results.json)
198+
199+
http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
200+
response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
201+
202+
# We want to throw an error if the data was not successfully submitted
203+
if [ "$http_status" -ne 200 ]; then
204+
echo "Error: Received HTTP status $http_status"
205+
echo "Response Body: $response_body"
206+
exit 1
207+
fi
208+
209+
echo "Response Body: $response_body"
210+
echo "HTTP Status: $http_status"
177211
178212
"backtrace":
179213
- command: shell.exec

0 commit comments

Comments
 (0)