org.apache.storm.metrics2

## Class DimensionalReporter

- java.lang.Object
- - com.codahale.metrics.ScheduledReporter
  - - org.apache.storm.metrics2.DimensionalReporter

- All Implemented Interfaces:
    com.codahale.metrics.Reporter, Closeable, AutoCloseable

      public class DimensionalReporter
      extends com.codahale.metrics.ScheduledReporter

  Class that allows using a ScheduledReporter to report V2 task metrics with support for dimensions.

  This reporter will be started and scheduled with the MetricRegistry. Once it is called on to report, it will query the StormMetricRegistry for various sets of task metrics with unique dimensions. The underlying ScheduledReporter will perform the actual reporting with the help of a DimensionHandler to deal with the dimensions.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `DimensionalReporter.DimensionHandler`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DimensionalReporter(MetricRegistryProvider metricRegistryProvider, com.codahale.metrics.ScheduledReporter unstartedReporter, DimensionalReporter.DimensionHandler dimensionHandler, String name, com.codahale.metrics.MetricFilter filter, TimeUnit rateUnit, TimeUnit durationUnit, ScheduledExecutorService executor, boolean shutdownExecutorOnStop)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `report()`
    `void` | `report(SortedMap<String,com.codahale.metrics.Gauge> gauges, SortedMap<String,com.codahale.metrics.Counter> counters, SortedMap<String,com.codahale.metrics.Histogram> histograms, SortedMap<String,com.codahale.metrics.Meter> meters, SortedMap<String,com.codahale.metrics.Timer> timers)`

    - ### Methods inherited from class com.codahale.metrics.ScheduledReporter

      `close, convertDuration, convertRate, getDisabledMetricAttributes, getDurationUnit, getRateUnit, isShutdownExecutorOnStop, start, start, stop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DimensionalReporter

          public DimensionalReporter(MetricRegistryProvider metricRegistryProvider,
                                     com.codahale.metrics.ScheduledReporter unstartedReporter,
                                     DimensionalReporter.DimensionHandler dimensionHandler,
                                     String name,
                                     com.codahale.metrics.MetricFilter filter,
                                     TimeUnit rateUnit,
                                     TimeUnit durationUnit,
                                     ScheduledExecutorService executor,
                                     boolean shutdownExecutorOnStop)

      Constructor.

      Parameters:
        `metricRegistryProvider` - MetricRegistryProvider tracking task-specific metrics.
        `unstartedReporter` - ScheduledReporter to perform the actual reporting. It should NOT be started.
        `dimensionHandler` - class to handle setting dimensions before reporting a set of metrics.
        `name` - the reporter’s name.
        `filter` - the filter for which metrics to report.
        `rateUnit` - rate unit for the reporter.
        `durationUnit` - duration unit for the reporter.
        `executor` - the executor to use while scheduling reporting of metrics.
        `shutdownExecutorOnStop` - if true, then executor will be stopped in same time with this reporter.

  - ### Method Detail

    - #### report

          public void report(SortedMap<String,com.codahale.metrics.Gauge> gauges,
                             SortedMap<String,com.codahale.metrics.Counter> counters,
                             SortedMap<String,com.codahale.metrics.Histogram> histograms,
                             SortedMap<String,com.codahale.metrics.Meter> meters,
                             SortedMap<String,com.codahale.metrics.Timer> timers)

      Specified by:
        `report` in class `com.codahale.metrics.ScheduledReporter`

    - #### report

          public void report()

      Overrides:
        `report` in class `com.codahale.metrics.ScheduledReporter`

Copyright © 2021 The Apache Software Foundation. All rights reserved.