Based on async-profiler 2.8.3
This is not a fork of async-profiler. This is a work derived from async-profiler but tailored very specifically for Datadog needs. If you need a full-fledged Java profiler head back to async-profiler
!TODO!
In order to ease up consuming of the java-profiler library in downstream projects (eg. dd-trace-java) it is possible to quickly build a maven artifact (jar) which can replace the stable dependency to test the changes.
The local build requires docker and Java 11 to be installed.
Use ./datadog/scripts/build_locally.sh to build linux-x64 only maven artifact.
After running this script you should see something like
jaroslav.bachorik@COMP-C02FJ0PSMD6V java-profiler % ./datadog/scripts/build_locally.sh === Building Java Profiler == Version : 2.6-DD-jb_local_artifact-bc38fb7712459603349d7a36a90c9d02611a450d == Architecture: linux-amd64 == With tests : no -> Building native library -> Building maven artifact -> Build done : Artifacts available | * file:///tmp/ap-tools-2.6-DD-jb_local_artifact-bc38fb7712459603349d7a36a90c9d02611a450d.jarThe artifact version contain the encoded branch name and the HEAD commit hash - which makes it easily identifiable. The actual path of the built artifact depends on your system but you can easily copy-paste it around.
The build script support the following arguments:
-a <architecture>- one of
linux-x64,linux-x64-muslorlinux-arm64(defaults tolinux-x64)
- one of
-f- force docker image rebuild
-t- force test run
-h- show help
For dd-trace-java you just need to set the java.profiler.jar project property. Eg. you can run the gradle build like this - ./gradlew clean -Pjava.profiler.jar=file:///tmp/ap-tools-2.6-DD-jb_local_artifact-bc38fb7712459603349d7a36a90c9d02611a450d.jar :dd-java-agent:shadowJar- which will result in a customdd-java-agent.jar` build containing your test version of Java profiler.