-
Notifications
You must be signed in to change notification settings - Fork 11
basic docs on jbang usage #9
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
2 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,8 @@ Or you can depend on the artifacts from maven central, they should be slightly m | |
|
||
Others are of course available, see [maven central](https://search.maven.org/artifact/me.bechberger/ap-loader). | ||
|
||
You can also use [JBang](https://jbang.dev) to simplify the usage of ap-loader. There are examples in documentation below. | ||
|
||
Supported Platforms | ||
------------------- | ||
|
||
|
@@ -68,7 +70,17 @@ Commands | |
|
||
The following is a more in-depth description of the commands of `java -jar ap-loader.jar`. | ||
|
||
Be aware that it is recommended to use run the JVM with the | ||
To run with JBang you can do `jbang ap-loader@jvm-profiling-tools/ap-loader` or install it as an application: | ||
|
||
```sh | ||
jbang app install ap-loader@jvm-profiling-tools/ap-loader | ||
``` | ||
|
||
and run it directly with `ap-loader` instead of `java -jar ap-loader.jar`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is confusing, or I can just run |
||
|
||
If you want to install a specific `ap-loader` rather than latest you can use `jbang app install me.bechberger:ap-loader-all:<version>`. | ||
|
||
Be aware that it is recommended to run the JVM with the | ||
`-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints` flags. | ||
This improves the accuracy of the profiler. | ||
|
||
|
@@ -160,6 +172,12 @@ This can be used to profile a Java process from the start. | |
java -javaagent:ap-loader.jar=start,event=cpu,file=profile.html <java arguments> | ||
``` | ||
|
||
With JBang you can do: | ||
|
||
```sh | ||
jbang --javaagent:ap-loader@jvm-profiling-tools/ap-loader=start,event=cpu,file=profile.html <java arguments> | ||
``` | ||
|
||
See the [GitHub page of async-profiler](https://github.com/jvm-profiling-tools/async-profiler) for more details. | ||
|
||
Usage in Java Code | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make it a single command and the whole JBang part one paragraph