SeaLights Java Agent - Using the Java Production Listener
The production listener samples real production data at specified intervals to add an additional layer of data that goes in line with the Test Gap Analytics report.
Downloading Agent file
Download it from: https://sl-repo.s3.amazonaws.com/sl-production-listener/sl-production-listener-3.1.1956.zip
Configuration File
Create a configuration file and provide its location using the -Dsl.config.file flag or call it 'sealights-pl-cfg.json' and place it in the current working directory of the JVM
It should contain the following minimum set of parameters:
token or tokenFile - The token to be used to send the data to SeaLights (Mandatory for online mode)
buildSessionId or buildSessionIdFile - The build session ID that was used to scan the application with (Mandatory for online mode)
includes - Comma separated list of packages to include
excludes - (Optional) Comma separated list of packages to exclude
Below, a sample recommended configuration (Online mode) for the production listener agent.
{
"token": "${SL_TOKEN}",
"buildSessionIdFile": "/root/sealights/buildSessionId.txt",
"includes":"com.example.*"
}
See 'Configuration File Parameters Reference' for full parameter details
The agent supports an “offline mode” described in the Advanced Settings section below.
Installing the Production Listener
The production listener needs to be placed alongside the server and added to the JVM command line using the -javaagent parameter together with its required parameters.
java -javaagent:/path/to/sl-production-listener.jar -Dsl.config.file=/path/to/config.json -jar yourapp.jar
On versions 8.5+ of Apache Tomcat, additional configuration may be required as described in the relevant section below.
Using the Production Insights Data
Data collected about application usage by the production listener will later be reported on the Test Gap Analytics report accessible from the dashboard.
Once production data is received for a reported application, the data will be reflected in the "usage" columns, referring to used code that is both modified and untested, as well as the overall used code which is untested.
Configuring Production Listener on Tomcat
On versions 8.5+ of Apache Tomcat, additional configuration needs to be made in the Tomcat configuration
Errors related to StandardJarScanner
This element represents the component that is used to scan the web application for JAR files and directories of class files.