They are currently not passed by ring and therefore only taken from current node, which returns incorrect (local) value.
See CacheMetricsSnapshot class.
Use long type for size and keySize in cache metrics
Failure to submit affinity task from client node
Entries count in caches' MX Beans not immediately available
GitHub Pull Request #5757
GitHub Pull Request #5857