flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] zentol commented on a change in pull request #15972: Add common source and operator metrics.
Date Thu, 20 May 2021 09:50:27 GMT

zentol commented on a change in pull request #15972:
URL: https://github.com/apache/flink/pull/15972#discussion_r635944709



##########
File path: flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/CommonMetricNames.java
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.flink.metrics;
+
+import org.apache.flink.annotation.PublicEvolving;
+
+/** Collection of metric names. */
+@PublicEvolving
+public class CommonMetricNames {
+    private CommonMetricNames() {}
+
+    public static final String SUFFIX_RATE = "PerSecond";
+
+    public static final String IO_NUM_RECORDS_IN = "numRecordsIn";

Review comment:
       Is this really necessary? TBH I find it a bit questionable because the field becomes
part of the API, and not the actual value within (which is what we actually care about).

##########
File path: flink-metrics/flink-metrics-core/pom.xml
##########
@@ -35,6 +35,12 @@ under the License.
 	<packaging>jar</packaging>
 
 	<dependencies>
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-annotations</artifactId>

Review comment:
       For historic reasons flink-metrics-core has no further dependencies, and ideally we
change that as an independent effort

##########
File path: flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/groups/OperatorIOMetricGroup.java
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.flink.metrics.groups;
+
+import org.apache.flink.metrics.Counter;
+import org.apache.flink.metrics.MetricGroup;
+
+/**
+ * Metric group that contains shareable pre-defined IO-related metrics. The metrics registration
is
+ * forwarded to the parent operator metric group.

Review comment:
       ```suggestion
    * Metric group that contains shareable pre-defined IO-related metrics.
   ```
   This is a detail the user doesn't have to worry about.

##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/OperatorMetricGroup.java
##########
@@ -32,7 +32,8 @@
 
 /** Special {@link org.apache.flink.metrics.MetricGroup} representing an Operator. */
 @Internal
-public class OperatorMetricGroup extends ComponentMetricGroup<TaskMetricGroup> {
+public class OperatorMetricGroup extends ComponentMetricGroup<TaskMetricGroup>

Review comment:
       Rename to `InternalOperatorMetricGroup`

##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/AbstractTwoInputStreamTask.java
##########
@@ -48,7 +48,7 @@
      */
     public AbstractTwoInputStreamTask(Environment env) throws Exception {
         super(env);
-
+        // dummy

Review comment:
       ?

##########
File path: flink-core/src/main/java/org/apache/flink/api/common/functions/util/RuntimeUDFContext.java
##########
@@ -56,14 +57,14 @@ public RuntimeUDFContext(
             ExecutionConfig executionConfig,
             Map<String, Future<Path>> cpTasks,
             Map<String, Accumulator<?, ?>> accumulators,
-            MetricGroup metrics) {
+            UnregisteredMetricsGroup metrics) {
         this(
                 taskInfo,
                 userCodeClassLoader,
                 executionConfig,
                 cpTasks,
                 accumulators,
-                metrics,
+                (OperatorMetricGroup) metrics,

Review comment:
       Well this seems weird?

##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/OperatorIOMetricGroup.java
##########
@@ -27,7 +27,8 @@
  * Metric group that contains shareable pre-defined IO-related metrics. The metrics registration
is
  * forwarded to the parent operator metric group.
  */
-public class OperatorIOMetricGroup extends ProxyMetricGroup<OperatorMetricGroup> {
+public class OperatorIOMetricGroup extends ProxyMetricGroup<OperatorMetricGroup>

Review comment:
       Rename to `InternalOperatorIOMetricGroup`




-- 
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.

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



Mime
View raw message