
com.wavefront.agent.LogsUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proxy Show documentation
Show all versions of proxy Show documentation
Service for batching and relaying metric traffic to Wavefront
package com.wavefront.agent;
import com.wavefront.agent.formatter.DataFormat;
import com.wavefront.common.TaggedMetricName;
import com.yammer.metrics.core.Counter;
import com.yammer.metrics.core.Histogram;
import com.yammer.metrics.core.MetricsRegistry;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
/** @author Sumit Deo ([email protected]) */
public class LogsUtil {
public static final Set LOGS_DATA_FORMATS =
new HashSet<>(
Arrays.asList(
DataFormat.LOGS_JSON_ARR,
DataFormat.LOGS_JSON_LINES,
DataFormat.LOGS_JSON_CLOUDWATCH));
public static Counter getOrCreateLogsCounterFromRegistry(
MetricsRegistry registry, DataFormat format, String group, String name) {
return registry.newCounter(
new TaggedMetricName(group, name, "format", format.name().toLowerCase()));
}
public static Histogram getOrCreateLogsHistogramFromRegistry(
MetricsRegistry registry, DataFormat format, String group, String name) {
return registry.newHistogram(
new TaggedMetricName(group, name, "format", format.name().toLowerCase()), false);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy