shahrs87 commented on code in PR #1744:
URL: https://github.com/apache/phoenix/pull/1744#discussion_r1418022913
##########
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java:
##########
@@ -3490,7 +3496,11 @@ private void
invalidateServerMetadataCache(List<InvalidateServerMetadataCacheReq
// This will incur an extra RPC to the master. This RPC is
required since we want to
// get current list of regionservers.
Collection<ServerName> serverNames = admin.getRegionServers(true);
+ PhoenixStopWatch stopWatch = new PhoenixStopWatch().start();
invalidateServerMetadataCacheWithRetries(admin, serverNames,
requests, false);
+ metricsMetadataCachingSource
+
.addMetadataCacheInvalidationTotalTime(stopWatch.stop().elapsedMillis());
+
metricsMetadataCachingSource.incrementMetadataCacheInvalidationSuccessCount();
Review Comment:
Does this mean we will not update the total time incase the invalidation
fails? I think we should. WDYT?
@palashc
##########
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/metrics/MetricsMetadataCachingSource.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.coprocessor.metrics;
+
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+/**
+ * Interface for metrics about Distributed Metadata Caching
+ */
+public interface MetricsMetadataCachingSource extends BaseSource {
+ // Metrics2 and JMX constants
+ String METRICS_NAME = "MetadataCaching";
+ String METRICS_CONTEXT = "phoenix";
+ String METRICS_DESCRIPTION = "Metrics about Distributed Metadata Caching";
+ String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME;
+
+ String METADATA_VALIDATION_CACHE_HIT = "metadataValidationCacheHits";
+ String METADATA_VALIDATION_CACHE_HIT_DESC
+ = "Number of cache hits in PhoenixRegionServerEndpoint "
+ + "when serving validate ddl timestamp requests.";
+
+ String METADATA_VALIDATION_CACHE_MISS = "metadataValidationCacheMisses";
+ String METADATA_VALIDATION_CACHE_MISS_DESC
+ = "Number of cache misses in PhoenixRegionServerEndpoint "
+ + "when serving validate ddl timestamp requests.";
+
+ String VALIDATE_DDL_TIMESTAMP_REQUESTS = "validateDDLTimestampRequests";
Review Comment:
I think you missed the Last in validateLastDDLTimestampRequests
##########
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java:
##########
@@ -3490,7 +3496,11 @@ private void
invalidateServerMetadataCache(List<InvalidateServerMetadataCacheReq
// This will incur an extra RPC to the master. This RPC is
required since we want to
// get current list of regionservers.
Collection<ServerName> serverNames = admin.getRegionServers(true);
+ PhoenixStopWatch stopWatch = new PhoenixStopWatch().start();
invalidateServerMetadataCacheWithRetries(admin, serverNames,
requests, false);
+ metricsMetadataCachingSource
+
.addMetadataCacheInvalidationTotalTime(stopWatch.stop().elapsedMillis());
+
metricsMetadataCachingSource.incrementMetadataCacheInvalidationSuccessCount();
Review Comment:
We also need a metric for metadata cache invalidation failure count like we
have for success count.
--
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]