ajamato commented on a change in pull request #11184: [BEAM-4374] Update protos
related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r398812861
##########
File path:
runners/portability/java/src/main/java/org/apache/beam/runners/portability/PortableMetrics.java
##########
@@ -135,21 +131,23 @@ private static PortableMetrics
convertMonitoringInfosToMetricResults(
MetricKey.create(
labelsMap.get(STEP_NAME_LABEL),
MetricName.named(labelsMap.get(NAMESPACE_LABEL),
labelsMap.get(METRIC_NAME_LABEL)));
- MetricsApi.IntDistributionData intDistributionData =
-
monitoringInfo.getMetric().getDistributionData().getIntDistributionData();
- DistributionResult result =
- DistributionResult.create(
- intDistributionData.getSum(),
- intDistributionData.getCount(),
- intDistributionData.getMin(),
- intDistributionData.getMax());
- return MetricResult.create(key, false, result);
+ try {
+ InputStream input = monitoringInfo.getPayload().newInput();
+ long count = VARINT_CODER.decode(input);
Review comment:
ditto, please use helper here
----------------------------------------------------------------
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]
With regards,
Apache Git Services