All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.librato.metrics.reporter.DefaultLibratoClientFactory Maven / Gradle / Ivy

Go to download

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