Java Agent Configuration
Drill4J Java Agent is using JVMTI interface to analyze and instrument Application Under Test(AUT) in runtime.
#
DownloadJava Agent has two parts two it - JVM in .jar
and native in either .dll
or .so
depending on the platform.
Pick the platform appropriate release depending on where Application Under Test runs:
- Currently Linux and Windows are supported
- There are caveats to Alpine support
#
Start the agentYou have to provide the following string to java
command running your Application Under Test:
You can either directly bake it into java
launch like that
But more elegant and handier way is to use JAVA_TOOL_OPTIONS env variable which is picked up by Java automatically
Using JAVA_TOOL_OPTIONS option also allows to add Drill4J Java Agent to any Java app running inside Docker container without alterting the image.
This enables you to easily integrate Drill4J into any testing environment seamlessly - no need to rebuild the image, no need to deploy separate env to collect metrics
#
Delivery options#
ManualYou can simply download Drill4J Java Agent from its github releases page and place them next to App Under Test jar
#
Docker Shared VolumeWhen running under Docker it can be handier to use our small image, that runs a script to download these files into shared volume:
#
Kubernetes Init ContainerWhen running in Kubernetes consider using init containers to download agent files from github and make them available for pod running App Under Test
#
PurposeDrill4J Java Agent is responsible for multiple tasks:
- Analyze application's packages, classes, methods and send metadata (not the actual code) to Drill4J Admin Backend
- Instrument AUT code to enable code execution tracking (in other words, code coverage)
- Analyze incoming requests to extract tests context (supplied, for example, by either Drill4J Java Agent or Browser Extension)
See Data Colletion for a comprehensive in-depth summary