Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmarks workflow #3450

Merged
merged 6 commits into from
Nov 3, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: SDK Benchmark Tests

on:
push:
branches: [ main ]

jobs:
sdk-benchmarks:
env:
ocelotl marked this conversation as resolved.
Show resolved Hide resolved
py311: "3.11"
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-sdk-${{ matrix.os }}
runs-on: self-hosted
strategy:
# Ensures the entire test matrix is run, even if one permutation fails
fail-fast: false
matrix:
python-version: [py311]
os: [ubuntu-20.04, windows-2019]
steps:
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2
- name: Set up Python ${{ env[matrix.python-version] }}
uses: actions/setup-python@v2
with:
python-version: ${{ env[matrix.python-version] }}
architecture: 'x64'
- name: Install tox
run: pip install tox==3.27.1 -U tox-factor
ocelotl marked this conversation as resolved.
Show resolved Hide resolved
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v2
with:
path: |
.tox
~/.cache/pip
key: v3-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini',
'dev-requirements.txt') }}-core
- name: Run tox
run: tox -f ${{ matrix.python-version }}-sdk -- -k opentelemetry-sdk/tests/performance/benchmarks --benchmark-json=output.json
ocelotl marked this conversation as resolved.
Show resolved Hide resolved
- name: Report on SDK benchmark results
uses: benchmark-action/github-action-benchmark@v1
with:
name: OpenTelemetry Python SDK Benchmarks - Python ${{ env[matrix.python-version ]}} - SDK
tool: pytest
output-file-path: opentelemetry-sdk/tests/output.json
gh-pages-branch: benchmarks
github-token: ${{ secrets.GITHUB_TOKEN }}
# Make a commit on `gh-pages` with benchmarks from previous step
benchmark-data-dir-path: "benchmarks"
auto-push: true
max-items-in-chart: 100
# Alert with a commit comment on possible performance regression
ocelotl marked this conversation as resolved.
Show resolved Hide resolved
alert-threshold: 200%
ocelotl marked this conversation as resolved.
Show resolved Hide resolved
fail-on-alert: true
Loading