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

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

                Author: ASF GitHub Bot
            Created on: 19/Feb/19 22:05
            Start Date: 19/Feb/19 22:05
    Worklog Time Spent: 10m 
      Work Description: ryan-williams commented on pull request #7867: 
[BEAM-4775] key MetricResult by a MetricKey
URL: https://github.com/apache/beam/pull/7867#discussion_r258250130
 
 

 ##########
 File path: 
runners/spark/src/main/java/org/apache/beam/runners/spark/metrics/SparkBeamMetric.java
 ##########
 @@ -17,27 +17,30 @@
  */
 package org.apache.beam.runners.spark.metrics;
 
+import static java.util.stream.Collectors.toList;
 import static 
org.apache.beam.runners.core.metrics.MetricsContainerStepMap.asAttemptedOnlyMetricResults;
 
 import com.codahale.metrics.Metric;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.beam.runners.core.metrics.MetricsContainerStepMap;
 import org.apache.beam.sdk.metrics.DistributionResult;
 import org.apache.beam.sdk.metrics.GaugeResult;
+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.v20_0.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
 
 /**
  * An adapter between the {@link MetricsContainerStepMap} and Codahale's 
{@link Metric} interface.
  */
 class SparkBeamMetric implements Metric {
 
 Review comment:
   Agreed. Most of what I've done so far (in #7823) is [expanding the Java SDK 
metrics classes to support the wider MonitoringInfo data model] while 
[preserving semantics of existing code that assumes / requires user-metrics].
   
   In this case, [I end up adapting 
this](https://github.com/apache/beam/pull/7823/files#diff-2b144bc5b4cec16779fa6126425c6fe3R71)
 to use [a `MetricLabels.value()` 
API](https://github.com/apache/beam/pull/7823/files#diff-245a1fd7e743b2f382c978a12028f8c2R46)
 that assumes there is exactly one label set on the MonitoringInfo 
(`PTRANSFORM` xor `PCOLLECTION`) and uses that, so it should be reasonably 
"future-proofed"
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 200920)
    Time Spent: 9h 10m  (was: 9h)

> JobService should support returning metrics
> -------------------------------------------
>
>                 Key: BEAM-4775
>                 URL: https://issues.apache.org/jira/browse/BEAM-4775
>             Project: Beam
>          Issue Type: Bug
>          Components: beam-model
>            Reporter: Eugene Kirpichov
>            Assignee: Ryan Williams
>            Priority: Major
>              Labels: triaged
>          Time Spent: 9h 10m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/beam/blob/master/model/job-management/src/main/proto/beam_job_api.proto]
>  currently doesn't appear to have a way for JobService to return metrics to a 
> user, even though 
> [https://github.com/apache/beam/blob/master/model/fn-execution/src/main/proto/beam_fn_api.proto]
>  includes support for reporting SDK metrics to the runner harness.
>  
> Metrics are apparently necessary to run any ValidatesRunner tests because 
> PAssert needs to validate that the assertions succeeded. However, this 
> statement should be double-checked: perhaps it's possible to somehow work 
> with PAssert without metrics support.



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

Reply via email to