File tree 1 file changed +31
-2
lines changed
1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,35 @@ tasks:
36
36
TOPOLOGY : " server"
37
37
MONGODB_VERSION : " v6.0-perf"
38
38
- func : " run benchmark"
39
- - command : perf.send
39
+ - command : shell.exec
40
40
params :
41
- file : src/benchmark/.phpbench/results.json
41
+ script : |
42
+ # We use the requester expansion to determine whether the data is from a mainline evergreen run or not
43
+ if [ "${requester}" == "commit" ]; then
44
+ is_mainline=true
45
+ else
46
+ is_mainline=false
47
+ fi
48
+
49
+ # We parse the username out of the order_id as patches append that in and SPS does not need that information
50
+ parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')
51
+
52
+ # Submit the performance data to the SPS endpoint
53
+ response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
54
+ "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" \
55
+ -H 'accept: application/json' \
56
+ -H 'Content-Type: application/json' \
57
+ -d @src/benchmark/.phpbench/results.json)
58
+
59
+ http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
60
+ response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
61
+
62
+ # We want to throw an error if the data was not successfully submitted
63
+ if [ "$http_status" -ne 200 ]; then
64
+ echo "Error: Received HTTP status $http_status"
65
+ echo "Response Body: $response_body"
66
+ exit 1
67
+ fi
68
+
69
+ echo "Response Body: $response_body"
70
+ echo "HTTP Status: $http_status"
You can’t perform that action at this time.
0 commit comments