Skip to content

chore(benchmarks): combine ddtrace-run and startup benchmarks #13391

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
46 changes: 0 additions & 46 deletions benchmarks/ddtrace_run/config.yaml

This file was deleted.

68 changes: 0 additions & 68 deletions benchmarks/ddtrace_run/scenario.py

This file was deleted.

28 changes: 28 additions & 0 deletions benchmarks/startup/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
baseline: &defaults
env: {}
ddtrace_run: false
send_span: false
import_ddtrace: false
import_ddtrace_auto: false
import_flask: false
Expand Down Expand Up @@ -32,3 +34,29 @@ import_ddtrace_auto_django:
<<: *defaults
import_ddtrace_auto: true
import_django: true
ddtrace_run:
<<: *defaults
ddtrace_run: true
ddtrace_run_appsec:
<<: *defaults
env: {"DD_APPSEC_ENABLED": "true"}
ddtrace_run: true
ddtrace_run_profiling:
<<: *defaults
env: {"DD_PROFILING_ENABLED": "true"}
ddtrace_run: true
ddtrace_run_telemetry_enabled:
<<: *defaults
env: {"_DD_INSTRUMENTATION_TELEMETRY_TESTS_FORCE_APP_STARTED": "true"}
ddtrace_run: true
ddtrace_run_telemetry_disabled:
<<: *defaults
env: {"DD_INSTRUMENTATION_TELEMETRY_ENABLED": "false", "_DD_INSTRUMENTATION_TELEMETRY_TESTS_FORCE_APP_STARTED": "false"}
ddtrace_run: true
ddtrace_run_send_span:
<<: *defaults
send_span: true
ddtrace_run_runtime_metrics:
<<: *defaults
env: {"DD_RUNTIME_METRICS_ENABLED": "true"}
ddtrace_run: true
9 changes: 9 additions & 0 deletions benchmarks/startup/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
class Startup(bm.Scenario):
import_ddtrace: bool
import_ddtrace_auto: bool
ddtrace_run: bool
import_flask: bool
import_django: bool
send_span: bool
env: str

def run(self):
Expand All @@ -33,8 +35,15 @@ def run(self):
# `import django` doesn't really do anything, `django.core.management` is what `manage.py` uses
commands.append("import django.core.management")

if self.send_span:
commands.append("from ddtrace.trace import tracer")
commands.append("tracer.trace('test-x', service='bench-test').finish()")

args = ["python", "-c"] + [";".join(commands)]

if self.ddtrace_run:
args = ["ddtrace-run"] + args

def _(loops: int):
for _ in range(loops):
subprocess.check_call(args=args, env=env)
Expand Down
Loading