Class MetricsMap

  • All Implemented Interfaces:
    com.codahale.metrics.Gauge<Map<String,​Object>>, com.codahale.metrics.Metric, DynamicMBean, org.apache.solr.common.MapSerializable, org.apache.solr.common.MapWriter, org.apache.solr.common.NavigableObject, org.noggit.JSONWriter.Writable

    public class MetricsMap
    extends Object
    implements com.codahale.metrics.Gauge<Map<String,​Object>>, org.apache.solr.common.MapWriter, DynamicMBean
    Dynamically constructed map of metrics, intentionally different from MetricSet where each metric had to be known in advance and registered separately in MetricRegistry.

    Note: this awkwardly extends Gauge and not Metric because awkwardly Metric instances are not supported by MetricRegistryListener :(

    Note 2: values added to this metric map should belong to the list of types supported by JMX: OpenType.ALLOWED_CLASSNAMES_LIST, otherwise only their toString() representation will be shown in JConsole.