From 9304017cc0e75602e8b8e8ab933ffe2a253e3887 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 12 Jul 2024 11:03:01 -0600 Subject: [PATCH] Move benchmarks for b3 propagator and grpc exporter (#4050) Fixs #4049 Co-authored-by: Leighton Chen --- .../benchmark-requirements.txt | 1 + .../benchmarks/test_benchmark_trace_exporter.py | 0 .../test-requirements-0.txt | 1 - .../test-requirements-1.txt | 1 - opentelemetry-sdk/test-requirements.txt | 1 - .../opentelemetry-propagator-b3/benchmark-requirements.txt | 1 + .../trace/propagation/test_benchmark_b3_format.py | 0 .../opentelemetry-propagator-b3/test-requirements.txt | 1 - tox.ini | 6 ++++++ 9 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 exporter/opentelemetry-exporter-otlp-proto-grpc/benchmark-requirements.txt rename exporter/opentelemetry-exporter-otlp-proto-grpc/{tests/performance => }/benchmarks/test_benchmark_trace_exporter.py (100%) create mode 100644 propagator/opentelemetry-propagator-b3/benchmark-requirements.txt rename propagator/opentelemetry-propagator-b3/{tests/performance => }/benchmarks/trace/propagation/test_benchmark_b3_format.py (100%) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/benchmark-requirements.txt b/exporter/opentelemetry-exporter-otlp-proto-grpc/benchmark-requirements.txt new file mode 100644 index 0000000000..44564857ef --- /dev/null +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/benchmark-requirements.txt @@ -0,0 +1 @@ +pytest-benchmark==4.0.0 diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/performance/benchmarks/test_benchmark_trace_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/benchmarks/test_benchmark_trace_exporter.py similarity index 100% rename from exporter/opentelemetry-exporter-otlp-proto-grpc/tests/performance/benchmarks/test_benchmark_trace_exporter.py rename to exporter/opentelemetry-exporter-otlp-proto-grpc/benchmarks/test_benchmark_trace_exporter.py diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt index 5c9bd04d4d..abbd8927d0 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt @@ -9,7 +9,6 @@ pluggy==1.5.0 protobuf==3.20.3 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt index 50cbb0c2fe..250b55bed8 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt @@ -9,7 +9,6 @@ pluggy==1.5.0 protobuf==4.25.3 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/opentelemetry-sdk/test-requirements.txt b/opentelemetry-sdk/test-requirements.txt index 1edbe85961..8a7ccc7bd7 100644 --- a/opentelemetry-sdk/test-requirements.txt +++ b/opentelemetry-sdk/test-requirements.txt @@ -7,7 +7,6 @@ packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/propagator/opentelemetry-propagator-b3/benchmark-requirements.txt b/propagator/opentelemetry-propagator-b3/benchmark-requirements.txt new file mode 100644 index 0000000000..44564857ef --- /dev/null +++ b/propagator/opentelemetry-propagator-b3/benchmark-requirements.txt @@ -0,0 +1 @@ +pytest-benchmark==4.0.0 diff --git a/propagator/opentelemetry-propagator-b3/tests/performance/benchmarks/trace/propagation/test_benchmark_b3_format.py b/propagator/opentelemetry-propagator-b3/benchmarks/trace/propagation/test_benchmark_b3_format.py similarity index 100% rename from propagator/opentelemetry-propagator-b3/tests/performance/benchmarks/trace/propagation/test_benchmark_b3_format.py rename to propagator/opentelemetry-propagator-b3/benchmarks/trace/propagation/test_benchmark_b3_format.py diff --git a/propagator/opentelemetry-propagator-b3/test-requirements.txt b/propagator/opentelemetry-propagator-b3/test-requirements.txt index a86ca788ed..9fea63eff9 100644 --- a/propagator/opentelemetry-propagator-b3/test-requirements.txt +++ b/propagator/opentelemetry-propagator-b3/test-requirements.txt @@ -6,7 +6,6 @@ packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/tox.ini b/tox.ini index 9d768888c9..dfa3edd028 100644 --- a/tox.ini +++ b/tox.ini @@ -62,6 +62,7 @@ envlist = py3{8,9,10,11,12}-test-opentelemetry-exporter-otlp-proto-grpc-{0,1} ; intentionally excluded from pypy3 lint-opentelemetry-exporter-otlp-proto-grpc + benchmark-opentelemetry-exporter-otlp-proto-grpc ; The numbers at the end of the environment names ; below mean these dependencies are being used: @@ -91,6 +92,7 @@ envlist = py3{8,9,10,11,12}-test-opentelemetry-propagator-b3 pypy3-test-opentelemetry-propagator-b3 lint-opentelemetry-propagator-b3 + benchmark-opentelemetry-propagator-b3 py3{8,9,10,11,12}-test-opentelemetry-propagator-jaeger pypy3-test-opentelemetry-propagator-jaeger @@ -160,6 +162,7 @@ commands_pre = opentelemetry-exporter-otlp-proto-grpc-0: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt opentelemetry-exporter-otlp-proto-grpc-1: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt lint-opentelemetry-exporter-otlp-proto-grpc: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt + benchmark-exporter-otlp-proto-grpc: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/benchmark-requirements.txt opentelemetry-exporter-otlp-proto-http-0: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt opentelemetry-exporter-otlp-proto-http-1: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt @@ -178,6 +181,7 @@ commands_pre = exporter-zipkin-json: pip install -r {toxinidir}/exporter/opentelemetry-exporter-zipkin-json/test-requirements.txt propagator-b3: pip install -r {toxinidir}/propagator/opentelemetry-propagator-b3/test-requirements.txt + benchmark-opentelemetry-propagator-b3: pip install -r {toxinidir}/propagator/opentelemetry-propagator-b3/benchmark-requirements.txt propagator-jaeger: pip install -r {toxinidir}/propagator/opentelemetry-propagator-jaeger/test-requirements.txt @@ -266,6 +270,7 @@ commands = lint-opentelemetry-exporter-otlp-proto-grpc: flake8 --config {toxinidir}/.flake8 {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc lint-opentelemetry-exporter-otlp-proto-grpc: pylint {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry lint-opentelemetry-exporter-otlp-proto-grpc: pylint {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/tests + benchmark-opentelemetry-exporter-otlp-proto-grpc: pytest {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/benchmarks {posargs} --benchmark-json=exporter-otlp-proto-grpc-benchmark.json test-opentelemetry-exporter-otlp-proto-http: pytest {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/tests {posargs} lint-opentelemetry-exporter-otlp-proto-http: black --diff --check --config {toxinidir}/pyproject.toml {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http @@ -308,6 +313,7 @@ commands = lint-opentelemetry-propagator-b3: flake8 --config {toxinidir}/.flake8 {toxinidir}/propagator/opentelemetry-propagator-b3 lint-opentelemetry-propagator-b3: pylint {toxinidir}/propagator/opentelemetry-propagator-b3/src/opentelemetry lint-opentelemetry-propagator-b3: pylint {toxinidir}/propagator/opentelemetry-propagator-b3/tests + benchmark-opentelemetry-propagator-b3: pytest {toxinidir}/propagator/opentelemetry-propagator-b3/benchmarks {posargs} --benchmark-json=propagator-b3-benchmark.json test-opentelemetry-propagator-jaeger: pytest {toxinidir}/propagator/opentelemetry-propagator-jaeger/tests {posargs} lint-opentelemetry-propagator-jaeger: black --diff --check --config {toxinidir}/pyproject.toml {toxinidir}/propagator/opentelemetry-propagator-jaeger