Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 952339c

Browse files
authored
Add benchmarks workflow (open-telemetry#3450)
1 parent edaaade commit 952339c

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/benchmarks.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: SDK Benchmark Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
sdk-benchmarks:
9+
env:
10+
py311: "3.11"
11+
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-sdk-${{ matrix.os }}
12+
runs-on: self-hosted
13+
strategy:
14+
# Ensures the entire test matrix is run, even if one permutation fails
15+
fail-fast: false
16+
matrix:
17+
python-version: [py311]
18+
os: [ubuntu-20.04, windows-2019]
19+
steps:
20+
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
21+
uses: actions/checkout@v2
22+
- name: Set up Python ${{ env[matrix.python-version] }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ env[matrix.python-version] }}
26+
architecture: 'x64'
27+
- name: Install tox
28+
run: pip install tox==3.27.1 -U tox-factor
29+
- name: Cache tox environment
30+
# Preserves .tox directory between runs for faster installs
31+
uses: actions/cache@v2
32+
with:
33+
path: |
34+
.tox
35+
~/.cache/pip
36+
key: v3-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini',
37+
'dev-requirements.txt') }}-core
38+
- name: Run tox
39+
run: tox -f ${{ matrix.python-version }}-sdk -- -k opentelemetry-sdk/tests/performance/benchmarks --benchmark-json=output.json
40+
- name: Report on SDK benchmark results
41+
uses: benchmark-action/github-action-benchmark@v1
42+
with:
43+
name: OpenTelemetry Python SDK Benchmarks - Python ${{ env[matrix.python-version ]}} - SDK
44+
tool: pytest
45+
output-file-path: opentelemetry-sdk/tests/output.json
46+
gh-pages-branch: benchmarks
47+
github-token: ${{ secrets.GITHUB_TOKEN }}
48+
# Make a commit on `gh-pages` with benchmarks from previous step
49+
benchmark-data-dir-path: "benchmarks"
50+
auto-push: true
51+
max-items-in-chart: 100
52+
# Alert with a commit comment on possible performance regression
53+
alert-threshold: '200%'
54+
comment-on-alert: true

0 commit comments

Comments
 (0)