Skip to content

Commit 3e7fe32

Browse files
authored
basic docs on jbang usage (#9)
* basic docs on jbang usage * Update README.md
1 parent 3c81775 commit 3e7fe32

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ Or you can depend on the artifacts from maven central, they should be slightly m
4848

4949
Others are of course available, see [maven central](https://search.maven.org/artifact/me.bechberger/ap-loader).
5050

51+
You can also use [JBang](https://jbang.dev) to simplify the usage of ap-loader. There are examples in documentation below.
52+
5153
Supported Platforms
5254
-------------------
5355

@@ -68,7 +70,17 @@ Commands
6870

6971
The following is a more in-depth description of the commands of `java -jar ap-loader.jar`.
7072

71-
Be aware that it is recommended to use run the JVM with the
73+
To run with JBang you can do `jbang ap-loader@jvm-profiling-tools/ap-loader` or install it as an application:
74+
75+
```sh
76+
jbang app install ap-loader@jvm-profiling-tools/ap-loader
77+
```
78+
79+
and run it directly with `ap-loader` instead of `java -jar ap-loader.jar`.
80+
81+
If you want to install a specific `ap-loader` rather than latest you can use `jbang app install me.bechberger:ap-loader-all:<version>`.
82+
83+
Be aware that it is recommended to run the JVM with the
7284
`-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints` flags.
7385
This improves the accuracy of the profiler.
7486

@@ -160,6 +172,12 @@ This can be used to profile a Java process from the start.
160172
java -javaagent:ap-loader.jar=start,event=cpu,file=profile.html <java arguments>
161173
```
162174
175+
With JBang you can do:
176+
177+
```sh
178+
jbang --javaagent:ap-loader@jvm-profiling-tools/ap-loader=start,event=cpu,file=profile.html <java arguments>
179+
```
180+
163181
See the [GitHub page of async-profiler](https://github.com/jvm-profiling-tools/async-profiler) for more details.
164182
165183
Usage in Java Code

0 commit comments

Comments
 (0)