
com.librato.metrics.reporter.DefaultLibratoClientFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metrics-librato Show documentation
Show all versions of metrics-librato Show documentation
The LibratoReporter class runs in the background, publishing
metrics to the Librato Metrics API at the
specified interval.
The newest version!
package com.librato.metrics.reporter;
import com.librato.metrics.client.LibratoClient;
import com.librato.metrics.client.LibratoClientBuilder;
public class DefaultLibratoClientFactory implements ILibratoClientFactory {
public LibratoClient build(ReporterAttributes atts) {
LibratoClientBuilder builder = LibratoClient.builder(atts.email, atts.token)
.setURI(atts.url)
.setAgentIdentifier(Agent.AGENT_IDENTIFIER);
if (atts.readTimeout != null) {
builder.setReadTimeout(atts.readTimeout);
}
if (atts.connectTimeout != null) {
builder.setConnectTimeout(atts.connectTimeout);
}
if (atts.poster != null) {
builder.setPoster(atts.poster);
}
return builder.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy