Skip to content

Commit

Permalink
Use a dedicated file to define profiling scenario (#3598)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeauchesne authored Nov 29, 2024
1 parent 45656cc commit b102940
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
19 changes: 2 additions & 17 deletions utils/_context/_scenarios/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .open_telemetry import OpenTelemetryScenario
from .parametric import ParametricScenario
from .performance import PerformanceScenario
from .profiling import ProfilingScenario
from .test_the_test import TestTheTestScenario
from .auto_injection import InstallerAutoInjectionScenario, InstallerAutoInjectionScenarioProfiling
from .k8s_lib_injection import KubernetesScenario, WeblogInjectionScenario
Expand Down Expand Up @@ -70,23 +71,7 @@ def all_endtoend_scenarios(test_object):
doc="We use the open telemetry library to automatically instrument the weblogs instead of using the DD library. This scenario represents this case in the integration with different external systems, for example the interaction with sql database.",
)

profiling = EndToEndScenario(
"PROFILING",
library_interface_timeout=160,
agent_interface_timeout=160,
weblog_env={
"DD_PROFILING_ENABLED": "true",
"DD_PROFILING_UPLOAD_PERIOD": "10",
"DD_PROFILING_START_DELAY": "1",
# Used within Spring Boot native tests to test profiling without affecting tracing scenarios
"USE_NATIVE_PROFILING": "presence",
# Reduce noise
"DD_INSTRUMENTATION_TELEMETRY_ENABLED": "false",
},
doc="Test profiling feature. Not included in default scenario because is quite slow",
scenario_groups=[ScenarioGroup.PROFILING],
require_api_key=True, # for an unknown reason, /flush on nodejs takes days with a fake key on this scenario
)
profiling = ProfilingScenario("PROFILING")

sampling = EndToEndScenario(
"SAMPLING",
Expand Down
22 changes: 22 additions & 0 deletions utils/_context/_scenarios/profiling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from .core import ScenarioGroup
from .endtoend import EndToEndScenario


class ProfilingScenario(EndToEndScenario):
def __init__(self, name) -> None:
super().__init__(
name,
library_interface_timeout=160,
weblog_env={
"DD_PROFILING_ENABLED": "true",
"DD_PROFILING_UPLOAD_PERIOD": "10",
"DD_PROFILING_START_DELAY": "1",
# Used within Spring Boot native tests to test profiling without affecting tracing scenarios
"USE_NATIVE_PROFILING": "presence",
# Reduce noise
"DD_INSTRUMENTATION_TELEMETRY_ENABLED": "false",
},
doc="Test profiling feature. Not included in default scenario because is quite slow",
scenario_groups=[ScenarioGroup.PROFILING],
require_api_key=True, # for an unknown reason, /flush on nodejs takes days with a fake key on this scenario
)
2 changes: 2 additions & 0 deletions utils/scripts/compute_impacted_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def main():
r"utils/_context/_scenarios/integrations\.py": ScenarioGroup.INTEGRATIONS.value,
#### Docker SSI case
r"utils/docker_ssi/.*": ScenarioGroup.DOCKER_SSI.value,
### Profiling case
r"utils/_context/_scenarios/profiling\.py": ScenarioGroup.PROFILING.value,
### else, run all
r"utils/.*": ScenarioGroup.ALL.value,
## few files with no effect
Expand Down

0 comments on commit b102940

Please sign in to comment.