io.tiler.collectors.loggly.config.Config Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tiler-collector-loggly Show documentation
Show all versions of tiler-collector-loggly Show documentation
Loggly collector for the Tiler dashboard framework
package io.tiler.collectors.loggly.config;
import io.tiler.core.time.TimePeriodParser;
import java.util.List;
public class Config {
private final long collectionIntervalInMilliseconds;
private final List servers;
private final String metricNamePrefix;
public Config(String collectionInterval, List servers, String metricNamePrefix) {
if (collectionInterval == null) {
collectionInterval = "1h";
}
if (metricNamePrefix == null) {
metricNamePrefix = "loggly.";
}
this.collectionIntervalInMilliseconds = TimePeriodParser.parseTimePeriodToMilliseconds(collectionInterval);
this.servers = servers;
this.metricNamePrefix = metricNamePrefix;
}
public long collectionIntervalInMilliseconds() {
return collectionIntervalInMilliseconds;
}
public List servers() {
return servers;
}
public String metricNamePrefix() {
return metricNamePrefix;
}
public String getFullMetricName(Metric metric) {
return metricNamePrefix() + metric.name();
}
}