Class GridMetricManager
- java.lang.Object
-
- org.apache.ignite.internal.managers.GridManagerAdapter<MetricExporterSpi>
-
- org.apache.ignite.internal.processors.metric.GridMetricManager
-
- All Implemented Interfaces:
Iterable<ReadOnlyMetricRegistry>,GridComponent,GridManager,ReadOnlyMetricManager
public class GridMetricManager extends GridManagerAdapter<MetricExporterSpi> implements ReadOnlyMetricManager
This manager should provideReadOnlyMetricManagerfor each configuredMetricExporterSpi.- See Also:
MetricExporterSpi,MetricRegistry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classGridMetricManager.MemoryUsageMetricsMemory usage metrics.-
Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent
GridComponent.DiscoveryDataExchangeType
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLIENT_CONNECTOR_METRICSClient metrics prefix.static StringCLUSTER_METRICSCluster metrics prefix.static StringCPU_LOADCPU load metric name.static StringCPU_LOAD_DESCRIPTIONCPU load metric description.static StringCUSTOM_METRICSCustom metrics registry name.static StringDAEMON_THREAD_CNTDaemon thread count metric name.static StringGC_CPU_LOADGC CPU load metric name.static StringGC_CPU_LOAD_DESCRIPTIONGC CPU load metric description.static StringHISTOGRAM_CFG_PREFIXPrefix forHistogramMetricconfiguration property name.static StringHITRATE_CFG_PREFIXPrefix forHitRateMetricconfiguration property name.static StringIGNITE_METRICSIgnite node metrics prefix.static StringPEAK_THREAD_CNTPeak thread count metric name.static StringPME_DURATIONPME duration metric name.static StringPME_DURATION_HISTOGRAMHistogram of PME durations metric name.static StringPME_METRICSPartition map exchange metrics prefix.static StringPME_OPS_BLOCKED_DURATIONPME cache operations blocked duration metric name.static StringPME_OPS_BLOCKED_DURATION_HISTOGRAMHistogram of blocking PME durations metric name.static StringREBALANCEDWhether cluster is in fully rebalanced state metric name.static StringSYS_METRICSSystem metrics prefix.static StringTHREAD_CNTThread count metric name.static StringTOTAL_STARTED_THREAD_CNTTotal started thread count metric name.static StringTX_METRICSTransaction metrics prefix.static StringUP_TIMEUp time metric name.-
Fields inherited from class org.apache.ignite.internal.managers.GridManagerAdapter
ctx, log
-
-
Constructor Summary
Constructors Constructor Description GridMetricManager(GridKernalContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMetricRegistryCreationListener(Consumer<ReadOnlyMetricRegistry> lsnr)Adds listener of metrics registry creation events.voidaddMetricRegistryRemoveListener(Consumer<ReadOnlyMetricRegistry> lsnr)Adds listener of metrics registry remove events.voidconfigureHistogram(String name, long[] bounds)StoresHistogramMetricconfiguration in metastorage.voidconfigureHitRate(String name, long rateTimeInterval)ChangeHitRateMetricconfiguration if it exists.IgniteMetricscustom()<T extends Metric>
Tfind(String name, Class<T> type)MemoryUsageheapMemoryUsage()Returns the current memory usage of the heap.@NotNull Iterator<ReadOnlyMetricRegistry>iterator()MemoryUsagenonHeapMemoryUsage()protected voidonKernalStart0()MetricRegistryImplregistry(String name)Gets or creates metric registry.voidremove(String regName)Removes metric registry.voidremove(String regName, boolean removeCfg)Removes metric registry.voidstart()Starts grid component.voidstop(boolean cancel)Stops grid component.-
Methods inherited from class org.apache.ignite.internal.managers.GridManagerAdapter
assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, enabled, getSpi, getSpi, getSpis, inject, onAfterSpiStart, onBeforeSpiStart, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onKernalStop, onKernalStop0, onReconnected, printMemoryStats, startInfo, startSpi, stopInfo, stopSpi, toString, validateNode, validateNode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
SYS_METRICS
public static final String SYS_METRICS
System metrics prefix.- See Also:
- Constant Field Values
-
IGNITE_METRICS
public static final String IGNITE_METRICS
Ignite node metrics prefix.- See Also:
- Constant Field Values
-
PME_METRICS
public static final String PME_METRICS
Partition map exchange metrics prefix.- See Also:
- Constant Field Values
-
CLUSTER_METRICS
public static final String CLUSTER_METRICS
Cluster metrics prefix.- See Also:
- Constant Field Values
-
CLIENT_CONNECTOR_METRICS
public static final String CLIENT_CONNECTOR_METRICS
Client metrics prefix.
-
TX_METRICS
public static final String TX_METRICS
Transaction metrics prefix.- See Also:
- Constant Field Values
-
GC_CPU_LOAD
public static final String GC_CPU_LOAD
GC CPU load metric name.- See Also:
- Constant Field Values
-
GC_CPU_LOAD_DESCRIPTION
public static final String GC_CPU_LOAD_DESCRIPTION
GC CPU load metric description.- See Also:
- Constant Field Values
-
CPU_LOAD
public static final String CPU_LOAD
CPU load metric name.- See Also:
- Constant Field Values
-
CPU_LOAD_DESCRIPTION
public static final String CPU_LOAD_DESCRIPTION
CPU load metric description.- See Also:
- Constant Field Values
-
UP_TIME
public static final String UP_TIME
Up time metric name.- See Also:
- Constant Field Values
-
THREAD_CNT
public static final String THREAD_CNT
Thread count metric name.- See Also:
- Constant Field Values
-
PEAK_THREAD_CNT
public static final String PEAK_THREAD_CNT
Peak thread count metric name.- See Also:
- Constant Field Values
-
TOTAL_STARTED_THREAD_CNT
public static final String TOTAL_STARTED_THREAD_CNT
Total started thread count metric name.- See Also:
- Constant Field Values
-
DAEMON_THREAD_CNT
public static final String DAEMON_THREAD_CNT
Daemon thread count metric name.- See Also:
- Constant Field Values
-
PME_DURATION
public static final String PME_DURATION
PME duration metric name.- See Also:
- Constant Field Values
-
PME_OPS_BLOCKED_DURATION
public static final String PME_OPS_BLOCKED_DURATION
PME cache operations blocked duration metric name.- See Also:
- Constant Field Values
-
PME_DURATION_HISTOGRAM
public static final String PME_DURATION_HISTOGRAM
Histogram of PME durations metric name.- See Also:
- Constant Field Values
-
PME_OPS_BLOCKED_DURATION_HISTOGRAM
public static final String PME_OPS_BLOCKED_DURATION_HISTOGRAM
Histogram of blocking PME durations metric name.- See Also:
- Constant Field Values
-
REBALANCED
public static final String REBALANCED
Whether cluster is in fully rebalanced state metric name.- See Also:
- Constant Field Values
-
CUSTOM_METRICS
public static final String CUSTOM_METRICS
Custom metrics registry name.- See Also:
- Constant Field Values
-
HITRATE_CFG_PREFIX
public static final String HITRATE_CFG_PREFIX
Prefix forHitRateMetricconfiguration property name.
-
HISTOGRAM_CFG_PREFIX
public static final String HISTOGRAM_CFG_PREFIX
Prefix forHistogramMetricconfiguration property name.
-
-
Constructor Detail
-
GridMetricManager
public GridMetricManager(GridKernalContext ctx)
- Parameters:
ctx- Kernal context.
-
-
Method Detail
-
onKernalStart0
protected void onKernalStart0()
- Overrides:
onKernalStart0in classGridManagerAdapter<MetricExporterSpi>
-
start
public void start() throws IgniteCheckedExceptionStarts grid component.- Specified by:
startin interfaceGridComponent- Throws:
IgniteCheckedException- Throws in case of any errors.
-
stop
public void stop(boolean cancel) throws IgniteCheckedExceptionStops grid component.- Specified by:
stopin interfaceGridComponent- Parameters:
cancel- Iftrue, then all ongoing tasks or jobs for relevant components need to be cancelled.- Throws:
IgniteCheckedException- Thrown in case of any errors.
-
registry
public MetricRegistryImpl registry(String name)
Gets or creates metric registry.- Parameters:
name- Group name.- Returns:
- Group of metrics.
-
custom
public IgniteMetrics custom()
- Returns:
- Custom metrics.
-
iterator
@NotNull public @NotNull Iterator<ReadOnlyMetricRegistry> iterator()
- Specified by:
iteratorin interfaceIterable<ReadOnlyMetricRegistry>
-
addMetricRegistryCreationListener
public void addMetricRegistryCreationListener(Consumer<ReadOnlyMetricRegistry> lsnr)
Adds listener of metrics registry creation events.- Specified by:
addMetricRegistryCreationListenerin interfaceReadOnlyMetricManager- Parameters:
lsnr- Listener.
-
addMetricRegistryRemoveListener
public void addMetricRegistryRemoveListener(Consumer<ReadOnlyMetricRegistry> lsnr)
Adds listener of metrics registry remove events.- Specified by:
addMetricRegistryRemoveListenerin interfaceReadOnlyMetricManager- Parameters:
lsnr- Listener.
-
remove
public void remove(String regName)
Removes metric registry.- Parameters:
regName- Metric registry name.
-
remove
public void remove(String regName, boolean removeCfg)
Removes metric registry.- Parameters:
regName- Metric registry name.removeCfg-Trueif remove metric configurations.
-
configureHitRate
public void configureHitRate(String name, long rateTimeInterval) throws IgniteCheckedException
ChangeHitRateMetricconfiguration if it exists.- Parameters:
name- Metric name.rateTimeInterval- New rate time interval.- Throws:
IgniteCheckedException- If write of configuration failed.- See Also:
HitRateMetric.reset(long, int)
-
configureHistogram
public void configureHistogram(String name, long[] bounds) throws IgniteCheckedException
StoresHistogramMetricconfiguration in metastorage.- Parameters:
name- Metric name.bounds- New bounds.- Throws:
IgniteCheckedException- If write of configuration failed.
-
find
public <T extends Metric> T find(String name, Class<T> type)
- Parameters:
name- Metric name.type- Metric type.- Returns:
- Metric.
-
nonHeapMemoryUsage
public MemoryUsage nonHeapMemoryUsage()
- Returns:
- Memory usage of non-heap memory.
-
heapMemoryUsage
public MemoryUsage heapMemoryUsage()
Returns the current memory usage of the heap.- Returns:
- Memory usage or fake value with zero in case there was exception during take of metrics.
-
-