public class MetricUtils extends Object
Constructor and Description |
---|
MetricUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addMetrics(NamedList<Object> lst,
Timer timer)
Adds metrics from a Timer to a NamedList, using well-known back-compat names.
|
static ExecutorService |
instrumentedExecutorService(ExecutorService delegate,
MetricRegistry metricRegistry,
String scope)
Returns an instrumented wrapper over the given executor service.
|
static NamedList |
toNamedList(MetricRegistry registry,
List<MetricFilter> shouldMatchFilters,
MetricFilter mustMatchFilter)
Returns a NamedList representation of the given metric registry.
|
public MetricUtils()
public static void addMetrics(NamedList<Object> lst, Timer timer)
lst
- The NamedList to add the metrics data totimer
- The Timer to extract the metrics frompublic static NamedList toNamedList(MetricRegistry registry, List<MetricFilter> shouldMatchFilters, MetricFilter mustMatchFilter)
registry
- the MetricRegistry
to be converted to NamedListshouldMatchFilters
- a list of MetricFilter
instances.
A metric must match any one of the filters from this list to be
included in the outputmustMatchFilter
- a MetricFilter
.
A metric must match this filter to be included in the output.NamedList
public static ExecutorService instrumentedExecutorService(ExecutorService delegate, MetricRegistry metricRegistry, String scope)