this.meterNamesByStatusCode = meterNamesByStatusCode;
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
final MetricRegistry metricsRegistry = getMetricsFactory(filterConfig);
String metricName = filterConfig.getInitParameter(METRIC_PREFIX);
if(metricName == null || metricName.isEmpty()) {
metricName = getClass().getName();
}
this.metersByStatusCode = new ConcurrentHashMap<Integer, Meter>(meterNamesByStatusCode
.size());
for (Entry<Integer, String> entry : meterNamesByStatusCode.entrySet()) {
metersByStatusCode.put(entry.getKey(),
metricsRegistry.meter(name(metricName, entry.getValue())));
}
this.otherMeter = metricsRegistry.meter(name(metricName,
otherMetricName));
this.activeRequests = metricsRegistry.counter(name(metricName,
"activeRequests"));
this.requestTimer = metricsRegistry.timer(name(metricName,
"requests"));
}