[
https://issues.apache.org/jira/browse/BEAM-6945?focusedWorklogId=221477&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-221477
]
ASF GitHub Bot logged work on BEAM-6945:
----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Apr/19 21:05
Start Date: 01/Apr/19 21:05
Worklog Time Spent: 10m
Work Description: ajamato 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_r271050465
##########
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:
Can we make this multiple classes instead, which will shorten the use a bit
MonitoringInfoConstants.Urns.ELEMENT_COUNT
becomes
MonitoringInfoUrns.ELEMENT_COUNT
MonitoringInfoConstants.Labels.PTRANSFORM
becomes
MonitoringInfoLabels.PTRANSFORM
MonitoringInfoConstants.TypeUrns.SUM_INT64
becomes
MonitoringInfoTypeUrns.SUM_INT64
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 221477)
Time Spent: 20m (was: 10m)
> 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: 20m
> 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)