Skip to content

Commit 49946a7

Browse files
Buristansergos
authored andcommitted
ci: send perf statistics to InfluxDB
This patch adds an additional steps in the <perf_micro.yml> workflow to aggregate and send aggregated data to InfluxDB via curl. Also, this patch adds the corresponding environment variables to be used during workflow to preserve the original commit hash and branch name. NO_DOC=CI NO_CHANGELOG=CI NO_TEST=CI
1 parent 9525791 commit 49946a7

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/perf_micro.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ jobs:
5252

5353
timeout-minutes: 60
5454

55+
env:
56+
PERF_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
57+
PERF_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
58+
5559
steps:
5660
- name: Prepare checkout
5761
uses: tarantool/actions/prepare-checkout@master
@@ -72,6 +76,27 @@ jobs:
7276
revision: ${{ inputs.revision }}
7377
- name: test
7478
run: make -f .test.mk test-perf
79+
- name: Aggregate benchmark results
80+
run: make -f .test.mk test-perf-aggregate
81+
- name: Send statistics to InfluxDB
82+
# TODO: For now, use the debug bucket for this PoC.
83+
# --silent -o /dev/null: Prevent dumping any reply part
84+
# in the output in case of an error.
85+
# --fail: Exit with the 22 error code is status >= 400.
86+
# --write-out: See the reason for the failure, if any.
87+
# --retry, --retry-delay: To avoid losing the results of
88+
# running after such a long job, try to retry sending the
89+
# results.
90+
run: >
91+
curl --request POST
92+
"${{ secrets.INFLUXDB_URL }}/api/v2/write?org=tarantool&bucket=perf-debug&precision=s"
93+
--write-out "%{http_code}"
94+
--retry 5
95+
--retry-delay 5
96+
--connect-timeout 120
97+
--fail --silent -o /dev/null
98+
--header "Authorization: Token ${{ secrets.INFLUXDB_TOKEN_DEBUG }}"
99+
--data-binary @./perf/output/summary.txt
75100
- name: Send VK Teams message on failure
76101
if: failure()
77102
uses: ./.github/actions/report-job-status

.test.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ test-perf: CMAKE_PARAMS = -DCMAKE_BUILD_TYPE=RelWithDebInfo \
8080

8181
test-perf: build run-perf-test
8282

83+
.PHONY: test-perf-aggregate
84+
test-perf-aggregate:
85+
cmake --build ${BUILD_DIR} --target test-perf-aggregate
86+
8387
# *_ASAN variables are common part of respective variables for all ASAN builds.
8488
CMAKE_PARAMS_ASAN = -DENABLE_WERROR=ON \
8589
-DENABLE_ASAN=ON \

0 commit comments

Comments
 (0)