Skip to content

Commit

Permalink
IGNITE-18232 Remove of CacheMetricsMXBean legacy JMX bean (apache#10485)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladsz83 authored and luchnikovbsk committed Jan 25, 2023
1 parent 8047b1b commit 0d037d2
Show file tree
Hide file tree
Showing 25 changed files with 122 additions and 1,717 deletions.
18 changes: 0 additions & 18 deletions docs/_docs/monitoring-metrics/configuring-metrics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,6 @@ include::{dotnetFile}[tag=cache-metrics,indent=0]
tab:C++[unsupported]
--

For each cache on a node, Ignite creates two JMX Beans: one with cache information specific to the node, and one with global (cluster-wide) information about the cache.

*Local cache information MBean:*::
+
....
group=<Cache_Name>,name="org.apache.ignite.internal.processors.cache.CacheLocalMetricsMXBeanImpl"
....


*Global cache information MBean:*::
+
----
group=<Cache_Name>,name="org.apache.ignite.internal.processors.cache.CacheClusterMetricsMXBeanImpl"
----

//See link:monitoring-metrics/monitoring-with-jconsole[Monitoring with JConsole] for the information on how to access JMX beans.


== Enabling Data Region Metrics
Data region metrics expose information about data regions, including memory and storage size of the region.
Enable data region metrics for every region you want to collect the metrics for.
Expand Down
44 changes: 4 additions & 40 deletions docs/_docs/monitoring-metrics/metrics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,7 @@ link:data-rebalancing[Rebalancing] is the process of moving partitions between t
If you have multiple caches, they will be rebalanced sequentially.
There are several metrics that you can use to monitor the progress of the rebalancing process for a specific cache.

Mbean's Object Name: ::
+
--
----
group=<cache name>,name=org.apache.ignite.internal.processors.cache.CacheLocalMetricsMXBeanImpl
----
In the new metric system, link:monitoring-metrics/new-metrics#caches[Cache metrics]:
[{table_opts}]
|===
| Attribute | Type | Description | Scope
Expand Down Expand Up @@ -297,36 +292,7 @@ ver=8.7.5#20190520-sha1:d159cd7a, isClient=false]

== Monitoring Caches

Cache-related metrics. For each cache, Ignite will create two JMX MBeans that will expose the metrics specific to the cache. One MBean shows cluster-wide information about the cache, such as the total number of entries in the cache. The other MBean shows local information about the cache, such as the number of entries of the cache that are located on the local node.


Global Cache Mbean's Object Name: ::
+
--
....
group=<Cache_Name>,name="org.apache.ignite.internal.processors.cache.CacheClusterMetricsMXBeanImpl"`
....

[{table_opts}]
|===
| Attribute | Type | Description | Scope
| CacheSize | long | The total number of entries in the cache across all nodes. | Global
|===
--

Local Cache Mbean's Object Name: ::
+
--
----
group=<Cache Name>,name="org.apache.ignite.internal.processors.cache.CacheLocalMetricsMXBeanImpl"
----

[{table_opts}]
|===
| Attribute | Type | Description | Scope
| CacheSize | long | The number of entries of the cache that are stored on the local node. | Node
|===
--
See the new metric system, link:monitoring-metrics/new-metrics#caches[Cache metrics].

=== Monitoring Build and Rebuild Indexes

Expand All @@ -338,11 +304,9 @@ To get an estimate on how long it takes to rebuild cache indexes, you can use on
Note that the `IndexBuildCountPartitionsLeft` metric allows to estimate only an approximate number of indexes left to rebuild.
For a more accurate estimate, use the `IndexRebuildKeyProcessed` cache metric:

* Use `org.apache.ignite.mxbean.CacheMetricsMXBean#isIndexRebuildInProgress` to know whether the indexes are being rebuilt for the cache.
Note that presently only the `org.apache.ignite.internal.processors.cache.CacheLocalMetricsMXBeanImpl#isIndexRebuildInProgress` local metric is available.
* Use `isIndexRebuildInProgress` to know whether the indexes are being rebuilt for the cache.

* Use `org.apache.ignite.mxbean.CacheMetricsMXBean#getIndexRebuildKeysProcessed` to know the number of keys with rebuilt indexes. If the rebuilding is in progress, it gives a number of keys with indexes being rebuilt at the current moment. Otherwise, it gives a total number of the of keys with rebuilt indexes. The values are reset before the start of each rebuilding.
Note that presently only the `org.apache.ignite.internal.processors.cache.CacheLocalMetricsMXBeanImpl#getIndexRebuildKeysProcessed` local metric is available.
* Use `IndexRebuildKeysProcessed` to know the number of keys with rebuilt indexes. If the rebuilding is in progress, it gives a number of keys with indexes being rebuilt at the current moment. Otherwise, it gives a total number of the of keys with rebuilt indexes. The values are reset before the start of each rebuilding.

== Monitoring Transactions
Note that if a transaction spans multiple nodes (i.e., if the keys that are changed as a result of the transaction execution are located on multiple nodes), the counters will increase on each node. For example, the 'TransactionsCommittedNumber' counter will increase on each node where the keys affected by the transaction are stored.
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/monitoring-metrics/system-views.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ This view exposes information about currently running SQL queries.
|SUBJECT_ID | UUID | The subject ID of the entity that initiated the query
|===

== SQL_QUERY_HISTORY
== SQL_QUERIES_HISTORY

[{table_opts}]
|===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ public void testMetrics() throws Exception {
IgniteCache<Object, Object> jcacheDft = grid().cache(DEFAULT_CACHE_NAME);
IgniteCache<Object, Object> jcacheName = grid().cache(CACHE_NAME);

jcacheDft.localMxBean().clear();
jcacheDft.clearStatistics();

jcacheName.localMxBean().clear();
jcacheName.clearStatistics();

jcacheDft.put("key1", "val");
jcacheDft.put("key2", "val");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ public void testReplace() throws Exception {
*/
@Test
public void testMetrics() throws Exception {
grid().cache(DEFAULT_CACHE_NAME).localMxBean().clear();
grid().cache(CACHE_NAME).localMxBean().clear();
grid().cache(DEFAULT_CACHE_NAME).clearStatistics();
grid().cache(CACHE_NAME).clearStatistics();

grid().cache(DEFAULT_CACHE_NAME).put("key1", "val");
grid().cache(DEFAULT_CACHE_NAME).put("key2", "val");
Expand Down
15 changes: 0 additions & 15 deletions modules/core/src/main/java/org/apache/ignite/IgniteCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
import org.apache.ignite.lang.IgniteClosure;
import org.apache.ignite.lang.IgniteExperimental;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.mxbean.CacheMetricsMXBean;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionException;
import org.apache.ignite.transactions.TransactionHeuristicException;
Expand Down Expand Up @@ -1617,20 +1616,6 @@ public <T> IgniteFuture<Map<K, EntryProcessorResult<T>>> invokeAllAsync(Set<? ex
*/
public CacheMetrics localMetrics();

/**
* Gets whole cluster MxBean for this cache.
*
* @return MxBean.
*/
public CacheMetricsMXBean mxBean();

/**
* Gets local MxBean for this cache.
*
* @return MxBean.
*/
public CacheMetricsMXBean localMxBean();

/**
* Gets a collection of lost partition IDs.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.IgnitionEx;
import org.apache.ignite.internal.mxbean.IgniteStandardMXBean;
import org.apache.ignite.internal.processors.cache.CacheClusterMetricsMXBeanImpl;
import org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy;
import org.apache.ignite.internal.util.IgniteUtils;
import org.apache.ignite.internal.util.typedef.internal.CU;
Expand Down Expand Up @@ -319,7 +320,7 @@ private ObjectName getObjectName(String cacheName, String objName) {
throw new CacheException("Cache not found: " + cacheName);

if (enabled)
registerCacheObject(cache.mxBean(), cacheName, CACHE_CONFIGURATION);
registerCacheObject(new CacheClusterMetricsMXBeanImpl(cache), cacheName, CACHE_CONFIGURATION);
else
unregisterCacheObject(cacheName, CACHE_CONFIGURATION);

Expand All @@ -344,7 +345,7 @@ private ObjectName getObjectName(String cacheName, String objName) {
throw new CacheException("Cache not found: " + cacheName);

if (enabled)
registerCacheObject(cache.mxBean(), cacheName, CACHE_STATISTICS);
registerCacheObject(new CacheClusterMetricsMXBeanImpl(cache), cacheName, CACHE_STATISTICS);
else
unregisterCacheObject(cacheName, CACHE_STATISTICS);

Expand Down

0 comments on commit 0d037d2

Please sign in to comment.