Package org.apache.solr.metrics
Class MetricsMap
- java.lang.Object
- 
- org.apache.solr.metrics.MetricsMap
 
- 
- All Implemented Interfaces:
- com.codahale.metrics.Gauge<Map<String,Object>>,- com.codahale.metrics.Metric,- DynamicMBean,- MapSerializable,- MapWriter,- NavigableObject
 
 public class MetricsMap extends Object implements com.codahale.metrics.Gauge<Map<String,Object>>, MapWriter, DynamicMBean Dynamically constructed map of metrics, intentionally different fromMetricSetwhere each metric had to be known in advance and registered separately inMetricRegistry.Note: this awkwardly extends Gaugeand notMetricbecause awkwardlyMetricinstances are not supported byMetricRegistryListener:(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.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriterMapWriter.EntryWriter
 
- 
 - 
Constructor SummaryConstructors Constructor Description MetricsMap(BiConsumer<Boolean,Map<String,Object>> mapInitializer)Deprecated.useMetricsMap(MapWriter)instead.MetricsMap(MapWriter initializer)Create an instance that reports values to a MapWriter.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String attribute)AttributeListgetAttributes(String[] attributes)MBeanInfogetMBeanInfo()Map<String,Object>getValue()Map<String,Object>getValue(boolean detailed)Objectinvoke(String actionName, Object[] params, String[] signature)voidsetAttribute(Attribute attribute)AttributeListsetAttributes(AttributeList attributes)StringtoString()voidwriteMap(MapWriter.EntryWriter ew)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.solr.common.NavigableObject_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
 
- 
 
- 
- 
- 
Constructor Detail- 
MetricsMap@Deprecated(since="8.7") public MetricsMap(BiConsumer<Boolean,Map<String,Object>> mapInitializer) Deprecated.useMetricsMap(MapWriter)instead.Create an instance that reports values to a Map.- Parameters:
- mapInitializer- function to populate the Map result.
 
 - 
MetricsMappublic MetricsMap(MapWriter initializer) Create an instance that reports values to a MapWriter.- Parameters:
- initializer- function to populate the MapWriter result.
 
 
- 
 - 
Method Detail- 
getAttributepublic Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException - Specified by:
- getAttributein interface- DynamicMBean
- Throws:
- AttributeNotFoundException
- MBeanException
- ReflectionException
 
 - 
setAttributepublic void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException - Specified by:
- setAttributein interface- DynamicMBean
- Throws:
- AttributeNotFoundException
- InvalidAttributeValueException
- MBeanException
- ReflectionException
 
 - 
getAttributespublic AttributeList getAttributes(String[] attributes) - Specified by:
- getAttributesin interface- DynamicMBean
 
 - 
setAttributespublic AttributeList setAttributes(AttributeList attributes) - Specified by:
- setAttributesin interface- DynamicMBean
 
 - 
invokepublic Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException - Specified by:
- invokein interface- DynamicMBean
- Throws:
- MBeanException
- ReflectionException
 
 - 
getMBeanInfopublic MBeanInfo getMBeanInfo() - Specified by:
- getMBeanInfoin interface- DynamicMBean
 
 - 
writeMappublic void writeMap(MapWriter.EntryWriter ew) throws IOException - Specified by:
- writeMapin interface- MapWriter
- Throws:
- IOException
 
 
- 
 
-