All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.alibaba.metrics.common.MetricsCollectorFactory Maven / Gradle / Ivy
package com.alibaba.metrics.common;
import com.alibaba.metrics.MetricFilter;
import java.util.HashMap;
import java.util.Map;
public class MetricsCollectorFactory {
public static MetricsCollector createNew(Map globalTags,
double rateFactor, double durationFactor) {
return createNew(CollectLevel.NORMAL, globalTags, rateFactor, durationFactor, null);
}
public static MetricsCollector createNew(CollectLevel level, Map globalTags,
double rateFactor, double durationFactor) {
return createNew(level, globalTags, rateFactor, durationFactor, null);
}
public static MetricsCollector createNew(CollectLevel level, double rateFactor, double durationFactor,
MetricFilter filter) {
return createNew(level, new HashMap(), rateFactor, durationFactor, filter);
}
public static MetricsCollector createNew(double rateFactor, double durationFactor, MetricFilter filter) {
return createNew(CollectLevel.NORMAL, new HashMap(), rateFactor, durationFactor, filter);
}
public static MetricsCollector createNew(CollectLevel collectLevel, Map globalTags, double rateFactor,
double durationFactor, MetricFilter filter) {
switch (collectLevel) {
case COMPACT:
return new CompactMetricsCollector(globalTags, rateFactor, durationFactor, filter);
case NORMAL:
return new NormalMetricsCollector(globalTags, rateFactor, durationFactor, filter);
case CLASSIFIER:
return new ClassifiedMetricsCollector(globalTags, rateFactor, durationFactor, filter);
case COMPLETE:
// FIXME: currently not supported
throw new UnsupportedOperationException("Currently not supported!");
default:
throw new IllegalStateException("Unsupported CollectLevel: " + collectLevel);
}
}
}