-
Notifications
You must be signed in to change notification settings - Fork 70
Make NodeJS profiling attachable #451
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4aad622
Make NodeJS profiling attachable
kwisniewski98 c72ac23
Review changes
kwisniewski98 d5f15f7
Reveiw changes v2
kwisniewski98 14b6899
Review changes v3
kwisniewski98 9d6175b
Add fix for missing .so in staticx
kwisniewski98 152dee8
Add handling for non-zero return code from list_needed_libs.sh
kwisniewski98 db7bec9
Review changes v4
kwisniewski98 ba0b5b0
Review changes v5
kwisniewski98 a5c1056
Ignore error from dockerfile lint
kwisniewski98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -10,3 +10,4 @@ types-PyYAML==6.0.3 | |
| types-pkg-resources==0.1.3 | ||
| types-protobuf==3.19.22 | ||
| types-toml==0.10.8 | ||
| types-retry==0.9.9 | ||
This file contains hidden or 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 hidden or 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 hidden or 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,35 @@ | ||
| # | ||
| # Copyright (c) Granulate. All rights reserved. | ||
| # Licensed under the AGPL3 License. See LICENSE.md in the project root for license information. | ||
| # | ||
| from subprocess import CompletedProcess | ||
| from threading import Event | ||
|
|
||
| from granulate_utils.linux.ns import get_process_nspid, run_in_ns | ||
| from psutil import Process | ||
|
|
||
| from gprofiler.utils import run_process | ||
|
|
||
|
|
||
| def get_exe_version( | ||
| process: Process, | ||
| stop_event: Event, | ||
| get_version_timeout: int, | ||
| version_arg: str = "--version", | ||
| try_stderr: bool = False, | ||
| ) -> str: | ||
| """ | ||
| Runs {process.exe()} --version in the appropriate namespace | ||
| """ | ||
| exe_path = f"/proc/{get_process_nspid(process.pid)}/exe" | ||
|
|
||
| def _run_get_version() -> "CompletedProcess[bytes]": | ||
| return run_process([exe_path, version_arg], stop_event=stop_event, timeout=get_version_timeout) | ||
|
|
||
| cp = run_in_ns(["pid", "mnt"], _run_get_version, process.pid) | ||
| stdout = cp.stdout.decode().strip() | ||
| # return stderr if stdout is empty, some apps print their version to stderr. | ||
| if try_stderr and not stdout: | ||
| return cp.stderr.decode().strip() | ||
|
|
||
| return stdout | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.