[ 
https://issues.apache.org/jira/browse/BEAM-6945?focusedWorklogId=221479&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-221479
 ]

ASF GitHub Bot logged work on BEAM-6945:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Apr/19 21:08
            Start Date: 01/Apr/19 21:08
    Worklog Time Spent: 10m 
      Work Description: Ardagan commented on pull request #8175: [BEAM-6945] 
Add single entry point for metrics.proto constants in java DF worker
URL: https://github.com/apache/beam/pull/8175#discussion_r271051938
 
 

 ##########
 File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/MonitoringInfoConstants.java
 ##########
 @@ -0,0 +1,78 @@
+/*
+ * 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.beam.runners.core.metrics;
+
+import static org.apache.beam.model.pipeline.v1.MetricsApi.labelProps;
+import static org.apache.beam.model.pipeline.v1.MetricsApi.monitoringInfoSpec;
+
+import org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfo;
+import 
org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfo.MonitoringInfoLabels;
+import org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfoSpecs;
+import org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfoTypeUrns;
+import org.apache.beam.model.pipeline.v1.RunnerApi;
+
+/** This static class fetches MonitoringInfo related values from 
metrics.proto. */
+public final class MonitoringInfoConstants {
+
+  /** Supported MonitoringInfo Urns. */
 
 Review comment:
   I believe all of these have tight relation through MonitoringInfo.
   Having them in single file/namespace is convenient to highlight the use case.
   
   Also, I don't feel we win much of shorter usage. To make thinks even 
shorter, you can import sub-class directly and then it will be: 
Urls.ELEMENT_COUNT, etc.
 
----------------------------------------------------------------
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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 221479)
    Time Spent: 0.5h  (was: 20m)

> Utilize label and urn values from metrics.proto in Java DF Runner
> -----------------------------------------------------------------
>
>                 Key: BEAM-6945
>                 URL: https://issues.apache.org/jira/browse/BEAM-6945
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-dataflow
>            Reporter: Mikhail Gryzykhin
>            Assignee: Mikhail Gryzykhin
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> We have some of values from metrics.proto hardcoded in java code. 
> Generalize access to those values and refactor Java DF Runner to utilize new 
> approach.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to