diff --git a/.evergreen/.evg.yml b/.evergreen/.evg.yml index d659a608cc..563eddea23 100644 --- a/.evergreen/.evg.yml +++ b/.evergreen/.evg.yml @@ -777,9 +777,40 @@ functions: PROJECT_DIRECTORY=${PROJECT_DIRECTORY} .evergreen/run-perf-tests.sh "send dashboard data": - - command: perf.send + - command: shell.exec + params: + script: | + if [ "${requester}" == "commit" ]; then + echo "is_mainline: true" >> expansion.yml + else + echo "is_mainline: false" >> expansion.yml + fi + + echo "parsed_order_id: $(echo "${revision_order_id}" | awk -F'_' '{print $NF}')" >> expansion.yml + - command: expansions.update + params: + file: expansion.yml + - command: shell.exec params: - file: src/results.json + script: | + 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 @src/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" "run graalvm native image app": - command: shell.exec