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

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

                Author: ASF GitHub Bot
            Created on: 26/Mar/20 18:51
            Start Date: 26/Mar/20 18:51
    Worklog Time Spent: 10m 
      Work Description: ajamato commented on pull request #11184: [BEAM-4374] 
Update protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r398812690
 
 

 ##########
 File path: 
runners/portability/java/src/main/java/org/apache/beam/runners/portability/PortableMetrics.java
 ##########
 @@ -115,17 +113,15 @@ private static PortableMetrics 
convertMonitoringInfosToMetricResults(
         MetricKey.create(
             labelsMap.get(STEP_NAME_LABEL),
             MetricName.named(labelsMap.get(NAMESPACE_LABEL), 
labelsMap.get(METRIC_NAME_LABEL)));
-    MetricsApi.IntExtremaData extremaData =
-        monitoringInfo.getMetric().getExtremaData().getIntExtremaData();
-    // Get only last value of the extrema table
-    Instant timestamp = 
Instant.ofEpochSecond(monitoringInfo.getTimestamp().getSeconds());
-    if (extremaData.getIntValuesCount() > 0) {
-      GaugeResult result =
-          GaugeResult.create(
-              extremaData.getIntValues(extremaData.getIntValuesCount() - 1), 
timestamp);
+    try {
+      InputStream input = monitoringInfo.getPayload().newInput();
+      long timestamp = VARINT_CODER.decode(input);
 
 Review comment:
   ditto, please use a helper here to make this a one liner to extract the value
 
----------------------------------------------------------------
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: 410508)
    Time Spent: 29.5h  (was: 29h 20m)

> Update existing metrics in the FN API to use new Metric Schema
> --------------------------------------------------------------
>
>                 Key: BEAM-4374
>                 URL: https://issues.apache.org/jira/browse/BEAM-4374
>             Project: Beam
>          Issue Type: New Feature
>          Components: beam-model
>            Reporter: Alex Amato
>            Priority: Major
>          Time Spent: 29.5h
>  Remaining Estimate: 0h
>
> Update existing metrics to use the new proto and cataloging schema defined in:
> [_https://s.apache.org/beam-fn-api-metrics_]
>  * Check in new protos
>  * Define catalog file for metrics
>  * Port existing metrics to use this new format, based on catalog 
> names+metadata



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

Reply via email to