-
Notifications
You must be signed in to change notification settings - Fork 8
feat(async-profiler): basic integration #770
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
Open
andrewazores
wants to merge
22
commits into
cryostatio:main
Choose a base branch
from
andrewazores:async-profiler
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
7 tasks
bb40463 to
3a7292c
Compare
7 tasks
169e3b1 to
d4b1fe3
Compare
… start time to state. do not include currently running session output file in repository list
This reverts commit 12764ac.
0212e7d to
d4e5308
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related to cryostatio/cryostat#643
Early draft. This includes a direct Maven dependency on async-profiler and some bootstrapping of it by the Cryostat Agent. That will need to be replaced by dynamic lookups of the async-profiler MXBean (or bean proxy) and no dependency on any async-profiler artifact. It will be up to the end user to get the correct async-profiler for their platform and architecture and attach that to their application (probably via-javaagent, but anything will work so long as the MXBean ends up present).Related: async-profiler/async-profiler#1628
async-profiler nightly builds as of async-profiler/async-profiler@bf84fad include async-profiler/async-profiler#1628 , which makes it so that when attaching the async-profiler.jar as a
-javaagentto a target application, the AsyncProfilerMXBean will be automatically registered in the target's platform (local) MBean server. If the Cryostat Agent is also attached to the same target then it will be able to detect the AsyncProfilerMXBean and provide integration functionality. This should land in async-profiler's upcoming feature release. Testing can also be done with any other sample application that has custom code added (the old way) to register the AsyncProfilerMXBean, so long as the async-profiler version is not severely outdated.Manual testing of this integration can be done by downloading the async-profiler.jar from the nightly release above, along with the appropriate os/arch distribution of the libasyncProfiler.so . This can be combined into the https://github.com/cryostatio/test-applications/tree/main/quarkus-agent with the following patch:
and placing the downloaded async-profiler.jar and libasyncProfiler.so into
src/main/docker/extras/async-profilerin the quarkus-agent test application.Otherwise, I have prepared a test image which can be used directly with the smoketest:
$ export QUARKUS_TEST_IMAGE=quay.io/andrewazores/quarkus-cryostat-agent:async-profiler-1Combine any method of obtaining an async-profiler equipped test application with the Cryostat and cryostat-web PRs and run
./smoktest.bash -O -t quarkus-cryostat-agent:Currently this implementation still uses an Agent HTTP invoke context and internally interfaces with the AsyncProfilerMXBean, so that the Agent can perform additional non-MXBean behaviours such as creating a disk repository for async-profiler dumps and listing or retrieving files from that disk repository. This functionality is not implemented by the AsyncProfilerMXBean, so although it's possible for Cryostat to interact with that MXBean directly either via JMX or via the Agent's MBean invoke context, it would not support all of the features we want to implement. Perhaps in the future we can work with the async-profiler team to enhance the Java side of its API and MXBean so that the remote management capabilities are a bit more fleshed out, if they are willing to accept these kinds of changes, and we can integrate directly via MXBean invoke (either JMX or Cryostat Agent HTTP).