Class NuxeoMetricSet

  • All Implemented Interfaces:
    io.dropwizard.metrics5.Metric, io.dropwizard.metrics5.MetricSet
    Direct Known Subclasses:
    GuavaCacheMetric

    public class NuxeoMetricSet
    extends Object
    implements io.dropwizard.metrics5.MetricSet
    Just a helper to easily declare metrics inside a MetricSet with th ease of Java 8 Lambda expression.
    Since:
    8.10-HF08, 9.2
    • Field Detail

      • metrics

        protected final Map<io.dropwizard.metrics5.MetricName,​io.dropwizard.metrics5.Metric> metrics
      • prefixName

        protected final io.dropwizard.metrics5.MetricName prefixName
    • Constructor Detail

      • NuxeoMetricSet

        public NuxeoMetricSet()
      • NuxeoMetricSet

        public NuxeoMetricSet​(String name,
                              String... names)
      • NuxeoMetricSet

        public NuxeoMetricSet​(io.dropwizard.metrics5.MetricName name)
      • NuxeoMetricSet

        public NuxeoMetricSet​(Supplier<Map<io.dropwizard.metrics5.MetricName,​io.dropwizard.metrics5.Metric>> metricsSupplier,
                              io.dropwizard.metrics5.MetricName name)
    • Method Detail

      • putGauge

        public <T> void putGauge​(io.dropwizard.metrics5.Gauge<T> gauge,
                                 io.dropwizard.metrics5.MetricName name)
        Put a gauge inside this MetricSet as name prefixName.name.names[0].names[1]...;
      • putGauge

        public <T> void putGauge​(io.dropwizard.metrics5.Gauge<T> gauge,
                                 String name,
                                 String... names)
      • getMetrics

        public Map<io.dropwizard.metrics5.MetricName,​io.dropwizard.metrics5.Metric> getMetrics()
        Specified by:
        getMetrics in interface io.dropwizard.metrics5.MetricSet
      • getPrefixName

        public io.dropwizard.metrics5.MetricName getPrefixName()
        Returns:
        the prefix name used by this MetricSet to prefix all added metrics, the value could be empty
      • getMetricNames

        public Set<io.dropwizard.metrics5.MetricName> getMetricNames()
        Returns:
        all metric names registered into this MetricSet