virajjasani commented on code in PR #1976:
URL: https://github.com/apache/phoenix/pull/1976#discussion_r1755293091
##########
phoenix-core-client/src/main/java/org/apache/phoenix/schema/PMetaDataCache.java:
##########
@@ -52,6 +53,16 @@ public void onRemoval(RemovalNotification<PTableKey,
PTableRef> notification) {
String key = notification.getKey().toString();
LOGGER.debug("Expiring " + key + " because of "
+ notification.getCause().name());
+ if (notification.wasEvicted()) {
+
GlobalClientMetrics.GLOBAL_CLIENT_METADATA_CACHE_EVICTION_COUNTER.increment();
+ } else {
+
GlobalClientMetrics.GLOBAL_CLIENT_METADATA_CACHE_REMOVAL_COUNTER.increment();
+ }
+ if (notification.getValue() != null) {
+ long newSize =
+
GlobalClientMetrics.GLOBAL_CLIENT_METADATA_CACHE_ESTIMATED_USED_SIZE.getMetric().getValue()
- notification.getValue().getEstimatedSize();
+
GlobalClientMetrics.GLOBAL_CLIENT_METADATA_CACHE_ESTIMATED_USED_SIZE.update(newSize);
Review Comment:
Can we do decrement here to be consistent with server side metrics
computation?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]