com.signalfx.metrics.connection.HttpEventProtobufReceiverConnectionV2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signalfx-codahale Show documentation
Show all versions of signalfx-codahale Show documentation
Dropwizard Codahale metrics plugin for signalfx
The newest version!
package com.signalfx.metrics.connection;
import java.util.List;
import com.signalfx.shaded.apache.http.HttpEntity;
import com.signalfx.shaded.apache.http.conn.HttpClientConnectionManager;
import com.signalfx.shaded.apache.http.entity.ByteArrayEntity;
import com.signalfx.endpoint.SignalFxReceiverEndpoint;
import com.signalfx.metrics.protobuf.SignalFxProtocolBuffers;
public class HttpEventProtobufReceiverConnectionV2
extends AbstractHttpEventProtobufReceiverConnection {
public HttpEventProtobufReceiverConnectionV2(
SignalFxReceiverEndpoint endpoint, int timeoutMs,
HttpClientConnectionManager httpClientConnectionManager) {
super(endpoint, timeoutMs, httpClientConnectionManager);
}
public HttpEventProtobufReceiverConnectionV2(
SignalFxReceiverEndpoint endpoint, int timeoutMs, int maxRetries,
HttpClientConnectionManager httpClientConnectionManager) {
super(endpoint, timeoutMs, maxRetries, httpClientConnectionManager);
}
@Override
protected String getEndpointForAddEvents() {
return "/v2/event";
}
@Override
protected HttpEntity getEntityForVersion(List events) {
byte[] bodyBytes = SignalFxProtocolBuffers.EventUploadMessage.newBuilder()
.addAllEvents(events).build().toByteArray();
return new ByteArrayEntity(bodyBytes, PROTO_TYPE);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy