Package jline.streaming
Class HttpMetricsClient
-
- All Implemented Interfaces:
public class HttpMetricsClientSimple 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
Constructors Constructor Description HttpMetricsClient(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 Type Method Description booleansendMetrics(List<SSAMetricPoint> metrics)Send a batch of metrics to the HTTP receiver. booleanisConnectionFailed()Check if connection has failed. voidshutdown()Shutdown the client. -
-
Constructor Detail
-
HttpMetricsClient
HttpMetricsClient(String endpoint, String serviceName)
Create a new HTTP metrics client.- Parameters:
endpoint- The HTTP receiver endpoint (e.g.serviceName- The service name to identify this simulation
-
HttpMetricsClient
HttpMetricsClient(String endpoint, String serviceName, boolean failOnConnectionError)
Create a new HTTP metrics client.- Parameters:
endpoint- The HTTP receiver endpoint (e.g.serviceName- The service name to identify this simulationfailOnConnectionError- If true, throw exception on connection failure
-
-
Method Detail
-
sendMetrics
boolean sendMetrics(List<SSAMetricPoint> metrics)
Send a batch of metrics to the HTTP receiver.
- Parameters:
metrics- List of metric points to send- Returns:
true if successful, false otherwise
-
isConnectionFailed
boolean isConnectionFailed()
Check if connection has failed.
- Returns:
true if connection failed and client is in dry-run mode
-
shutdown
void shutdown()
Shutdown the client.
-
-
-
-