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

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

                Author: ASF GitHub Bot
            Created on: 26/Nov/19 14:07
            Start Date: 26/Nov/19 14:07
    Worklog Time Spent: 10m 
      Work Description: echauchot commented on pull request #10105: [BEAM-4776] 
Add metrics support to Java PortableRunner
URL: https://github.com/apache/beam/pull/10105#discussion_r350760878
 
 

 ##########
 File path: 
runners/portability/java/src/main/java/org/apache/beam/runners/portability/PortableMetrics.java
 ##########
 @@ -0,0 +1,170 @@
+/*
+ * 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.portability;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.apache.beam.model.jobmanagement.v1.JobApi;
+import org.apache.beam.model.pipeline.v1.MetricsApi;
+import org.apache.beam.sdk.metrics.DistributionResult;
+import org.apache.beam.sdk.metrics.GaugeResult;
+import org.apache.beam.sdk.metrics.MetricFiltering;
+import org.apache.beam.sdk.metrics.MetricKey;
+import org.apache.beam.sdk.metrics.MetricName;
+import org.apache.beam.sdk.metrics.MetricQueryResults;
+import org.apache.beam.sdk.metrics.MetricResult;
+import org.apache.beam.sdk.metrics.MetricResults;
+import org.apache.beam.sdk.metrics.MetricsFilter;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables;
+import org.joda.time.Instant;
+
+public class PortableMetrics extends MetricResults {
+
+  private static final List<String> COUNTER_METRIC_TYPES =
+      ImmutableList.of("beam:metrics:sum_int_64");
+  private static final List<String> DISTRIBUTION_METRIC_TYPES =
+      ImmutableList.of("beam:metrics:distribution_int_64");
+  private static final List<String> GAUGE_METRIC_TYPES =
+      ImmutableList.of("beam:metrics:latest_int_64");
+
+  private static final String NAMESPACE_LABEL = "NAMESPACE";
+  private static final String METRIC_NAME_LABEL = "NAME";
+  private static final String STEP_NAME_LABEL = "PTRANSFORM";
+  private Iterable<MetricResult<Long>> counters;
+  private Iterable<MetricResult<DistributionResult>> distributions;
+  private Iterable<MetricResult<GaugeResult>> gauges;
+
+  private PortableMetrics(
 
 Review comment:
   @mwalenia to answer your question, I'm indeed the correct person for 
MetricsPusher related questions.
   Regarding MetricsPusher, the problem goes beyond the test itself. The whole 
MetricsPusher feature reports for now only user metrics (that is why the test 
sink that is tailored for it only reads user metrics). But the aim since the 
beginning of the architectural design (pull vs push essentially) was to allow 
in the future to support system metrics. Here is the design I did at the time: 
https://s.apache.org/runner_independent_metrics_extraction.
   Long story short, the good thing to do IMHO is to enhance MetricsPusher to 
support system metrics as well and, of course, update the test/sink.
 
----------------------------------------------------------------
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: 349802)
    Time Spent: 7h 50m  (was: 7h 40m)

> Java PortableRunner should support metrics
> ------------------------------------------
>
>                 Key: BEAM-4776
>                 URL: https://issues.apache.org/jira/browse/BEAM-4776
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-core
>            Reporter: Eugene Kirpichov
>            Assignee: Michal Walenia
>            Priority: Major
>          Time Spent: 7h 50m
>  Remaining Estimate: 0h
>
> BEAM-4775 concerns adding metrics to the JobService API; the current issue is 
> about making PortableRunner understand them.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to