-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(profiling): migrate to product interface
We migrate the profiler product to the product interface for automatic lifecycle and telemetry management.
- Loading branch information
Showing
12 changed files
with
70 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from ddtrace.settings.profiling import config | ||
|
||
|
||
def post_preload(): | ||
pass | ||
|
||
|
||
def start(): | ||
if config.enabled: | ||
import ddtrace.profiling.auto # noqa: F401 | ||
|
||
|
||
def restart(join=False): | ||
if config.enabled: | ||
from ddtrace.profiling import bootstrap | ||
|
||
try: | ||
bootstrap.profiler._restart_on_fork() | ||
except AttributeError: | ||
pass | ||
|
||
|
||
def stop(join=False): | ||
if config.enabled: | ||
from ddtrace.profiling import bootstrap | ||
|
||
try: | ||
bootstrap.profiler.stop() | ||
except AttributeError: | ||
pass | ||
|
||
|
||
def at_exit(join=False): | ||
stop(join=join) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import ddtrace.profiling.auto # noqa:F401 | ||
import os | ||
|
||
import ddtrace.auto # noqa:F401 | ||
|
||
|
||
def application(): | ||
pass | ||
|
||
|
||
if os.getenv("STOP_AFTER_LOAD"): | ||
import sys | ||
|
||
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters