use of org.apache.solr.metrics.AggregateMetric in project lucene-solr by apache.
the class MetricUtils method convertMetrics.
/**
* Convert selected metrics from a registry into maps (when <code>compact==false</code>) or
* flattened objects.
* @param registry registry
* @param names metric names
* @param skipHistograms discard any {@link Histogram}-s and histogram parts of {@link Timer}-s.
* @param skipAggregateValues discard internal values of {@link AggregateMetric}-s.
* @param compact use compact representation for counters and gauges.
* @param simple use simplified representation for complex metrics - instead of a (name, map)
* only the selected (name "." key, value) pairs will be produced.
* @param consumer consumer that accepts produced objects
*/
public static void convertMetrics(MetricRegistry registry, Collection<String> names, boolean skipHistograms, boolean skipAggregateValues, boolean compact, boolean simple, BiConsumer<String, Object> consumer) {
final Map<String, Metric> metrics = registry.getMetrics();
names.stream().forEach(n -> {
Metric metric = metrics.get(n);
convertMetric(n, metric, PropertyFilter.ALL, skipHistograms, skipAggregateValues, compact, simple, consumer);
});
}
Aggregations