Class MockApmServer
java.lang.Object
org.elasticsearch.gradle.testclusters.MockApmServer
This is a server which just accepts lines of JSON code and if the JSON
is valid and the root node is "transaction", then adds that JSON object
to a transaction list which is accessible externally to the class.
The Elastic agent sends lines of JSON code, and so this mock server can be used as a basic APM server for testing.
The HTTP server used is the JDK embedded com.sun.net.httpserver
-
Constructor Summary
ConstructorsConstructorDescriptionMockApmServer(String metricFilter, String transactionFilter, String transactionExcludesFilter) -
Method Summary
-
Constructor Details
-
MockApmServer
-
-
Method Details
-
start
Start the Mock APM server. Just returns empty JSON structures for every incoming message- Throws:
IOException
-
getPort
public int getPort() -
stop
public void stop()Stop the server gracefully if possible
-