divijvaidya commented on code in PR #14133:
URL: https://github.com/apache/kafka/pull/14133#discussion_r1281718684


##########
storage/api/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteStorageMetrics.java:
##########
@@ -0,0 +1,93 @@
+/*
+ * 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.kafka.server.log.remote.storage;
+
+import com.yammer.metrics.core.MetricName;
+import org.apache.kafka.server.metrics.KafkaYammerMetrics;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * This class contains the metrics related to tiered storage feature, which is 
to have a centralized
+ * place to store them, so that we can verify all of them easily.
+ *
+ * @see kafka.api.MetricsTest
+ */
+public class RemoteStorageMetrics {
+    public static final String REMOTE_LOG_READER_METRICS_NAME_PREFIX = 
"RemoteLogReader";
+    public static final String REMOTE_LOG_MANAGER_TASKS_AVG_IDLE_PERCENT = 
"RemoteLogManagerTasksAvgIdlePercent";
+    public static final String TASK_QUEUE_SIZE = "TaskQueueSize";
+    public static final String AVG_IDLE_PERCENT = "AvgIdlePercent";
+    public static final String REMOTE_BYTES_OUT_PER_SEC = 
"RemoteBytesOutPerSec";
+    public static final String REMOTE_BYTES_IN_PER_SEC = "RemoteBytesInPerSec";
+    public static final String REMOTE_READ_REQUESTS_PER_SEC = 
"RemoteReadRequestsPerSec";
+    public static final String REMOTE_WRITE_REQUESTS_PER_SEC = 
"RemoteWriteRequestsPerSec";
+    public static final String FAILED_REMOTE_READ_REQUESTS_PER_SEC = 
"RemoteReadErrorsPerSec";
+    public static final String FAILED_REMOTE_WRITE_REQUESTS_PER_SEC = 
"RemoteWriteErrorsPerSec";
+    public static final String REMOTE_LOG_READER_TASK_QUEUE_SIZE = 
REMOTE_LOG_READER_METRICS_NAME_PREFIX + TASK_QUEUE_SIZE;
+    public static final String REMOTE_LOG_READER_AVG_IDLE_PERCENT = 
REMOTE_LOG_READER_METRICS_NAME_PREFIX + AVG_IDLE_PERCENT;
+
+    public final static MetricName REMOTE_BYTES_OUT_PER_SEC_METRIC = 
getMetricName(
+            "kafka.server", "BrokerTopicMetrics", REMOTE_BYTES_OUT_PER_SEC);
+    public final static MetricName REMOTE_BYTES_IN_PER_SEC_METRIC = 
getMetricName(
+            "kafka.server", "BrokerTopicMetrics", REMOTE_BYTES_IN_PER_SEC);
+    public final static MetricName REMOTE_READ_REQUESTS_PER_SEC_METRIC = 
getMetricName(
+            "kafka.server", "BrokerTopicMetrics", 
REMOTE_READ_REQUESTS_PER_SEC);
+    public final static MetricName REMOTE_WRITE_REQUESTS_PER_SEC_METRIC = 
getMetricName(
+            "kafka.server", "BrokerTopicMetrics", 
REMOTE_WRITE_REQUESTS_PER_SEC);
+    public final static MetricName FAILED_REMOTE_READ_REQUESTS_PER_SEC_METRIC 
= getMetricName(
+            "kafka.server", "BrokerTopicMetrics", 
FAILED_REMOTE_READ_REQUESTS_PER_SEC);
+    public final static MetricName FAILED_REMOTE_WRITE_REQUESTS_PER_SEC_METRIC 
= getMetricName(
+            "kafka.server", "BrokerTopicMetrics", 
FAILED_REMOTE_WRITE_REQUESTS_PER_SEC);
+    public final static MetricName 
REMOTE_LOG_MANAGER_TASKS_AVG_IDLE_PERCENT_METRIC = getMetricName(
+            "kafka.log.remote", "RemoteLogManager", 
REMOTE_LOG_MANAGER_TASKS_AVG_IDLE_PERCENT);
+    public final static MetricName REMOTE_LOG_READER_TASK_QUEUE_SIZE_METRIC = 
getMetricName(
+            "org.apache.kafka.storage.internals.log", 
"RemoteStorageThreadPool", REMOTE_LOG_READER_TASK_QUEUE_SIZE);
+    public final static MetricName REMOTE_LOG_READER_AVG_IDLE_PERCENT_METRIC = 
getMetricName(
+            "org.apache.kafka.storage.internals.log", 
"RemoteStorageThreadPool", REMOTE_LOG_READER_AVG_IDLE_PERCENT);
+
+    public static Set<MetricName> allMetrics() {

Review Comment:
   the metrics you added in the last commit. e.g. 
`FAILED_REMOTE_WRITE_REQUESTS_PER_SEC` is missing and hence, our integration 
tests is not validating that this metric is not emitted when Tiered Storage is 
turned off.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to