dianfu commented on a change in pull request #11470: [FLINK-16671][python] 
Support for defining scopes and variables on Python metric group
URL: https://github.com/apache/flink/pull/11470#discussion_r397592767
 
 

 ##########
 File path: flink-python/pyflink/metrics/metricbase.py
 ##########
 @@ -0,0 +1,127 @@
+################################################################################
+#  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.
+################################################################################
+import abc
+from enum import Enum
+
+
+class MetricGroup(abc.ABC):
+
+    def add_group(self, name: str, extra: str = None) -> 'MetricGroup':
+        """
+        if extra is not None, creates a new key-value MetricGroup pair. The 
key group
+        is added to this groups sub-groups, while the value group is added to 
the key
+        group's sub-groups. This method returns the value group.
+
+        The only difference between calling this method and
+        `group.add_group(key).add_group(value)` is that get_all_variables()
+        of the value group return an additional `"<key>"="value"` pair.
+        """
+        pass
+
+    def get_scope_components(self) -> []:
+        """
+        Gets the scope as an array of the scope components, for example
+        `["host-7", "taskmanager-2", "window_word_count", "my-mapper"]`
+        """
+        pass
+
+    def get_all_variables(self) -> map:
 
 Review comment:
   map[str, str]

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to