@@ -170,10 +170,44 @@ functions:
170
170
file_location : mongo-c-driver/report.json
171
171
172
172
" 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"
177
211
178
212
" backtrace " :
179
213
- command : shell.exec
0 commit comments