Package jline.streaming
Class HttpMetricsClient
java.lang.Object
jline.streaming.HttpMetricsClient
Simple HTTP client for sending metrics to a receiver.
Uses Java's built-in HttpURLConnection for maximum compatibility
with all JVM environments including MATLAB.
Metrics are sent as JSON via HTTP POST.
-
Constructor Summary
ConstructorsConstructorDescriptionHttpMetricsClient(String endpoint, String serviceName) Create a new HTTP metrics client.HttpMetricsClient(String endpoint, String serviceName, boolean failOnConnectionError) Create a new HTTP metrics client. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if connection has failed.booleansendMetrics(List<SSAMetricPoint> metrics) Send a batch of metrics to the HTTP receiver.voidshutdown()Shutdown the client.
-
Constructor Details
-
HttpMetricsClient
Create a new HTTP metrics client.- Parameters:
endpoint- The HTTP receiver endpoint (e.g., "http://localhost:8080/metrics")serviceName- The service name to identify this simulation
-
HttpMetricsClient
Create a new HTTP metrics client.- Parameters:
endpoint- The HTTP receiver endpoint (e.g., "http://localhost:8080/metrics")serviceName- The service name to identify this simulationfailOnConnectionError- If true, throw exception on connection failure
-
-
Method Details
-
sendMetrics
Send a batch of metrics to the HTTP receiver.- Parameters:
metrics- List of metric points to send- Returns:
- true if successful, false otherwise
-
isConnectionFailed
public boolean isConnectionFailed()Check if connection has failed.- Returns:
- true if connection failed and client is in dry-run mode
-
shutdown
public void shutdown()Shutdown the client.
-