Skip to content

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 2 commits into from
Feb 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------------

Expand All @@ -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
Copy link
Member

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

jbang app install ap-loader@jvm-profiling-tools/ap-loader
```

and run it directly with `ap-loader` instead of `java -jar ap-loader.jar`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing, or I can just run ap-loader directly in my shell?


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.

Expand Down Expand Up @@ -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
Expand Down