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

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

                Author: ASF GitHub Bot
            Created on: 21/Aug/19 19:13
            Start Date: 21/Aug/19 19:13
    Worklog Time Spent: 10m 
      Work Description: Ardagan commented on pull request #9330: [BEAM-7969] 
Report FnAPI counters as deltas in streaming jobs.
URL: https://github.com/apache/beam/pull/9330#discussion_r316357323
 
 

 ##########
 File path: 
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java
 ##########
 @@ -1867,6 +1873,28 @@ private void sendWorkerUpdatesToDataflowService(
           cumulativeCounters.extractUpdates(false, 
DataflowCounterUpdateExtractor.INSTANCE));
       counterUpdates.addAll(
           
deltaCounters.extractModifiedDeltaUpdates(DataflowCounterUpdateExtractor.INSTANCE));
+      if (hasExperiment(options, "beam_fn_api")) {
+        while (!this.pendingMonitoringInfos.isEmpty()) {
+          final CounterUpdate item = this.pendingMonitoringInfos.poll();
+
+          // This change will treat counter as delta.
+          // This is required because we receive cumulative results from FnAPI 
harness,
+          // while streaming job is expected to receive delta updates to 
counters on same
+          // WorkItem.
+          if (item.getCumulative()) {
+            item.setCumulative(false);
+          } else {
+            // In current world all counters coming from FnAPI are cumulative.
+            // This is a safety check in case new counter type appears in 
FnAPI.
+            throw new UnsupportedOperationException(
 
 Review comment:
   That was bad way to formulate on my side:
   CounterUpdates are generated within Java DF Worker. So if we receive 
different type of CounterUpdate here, that means that someone modified DF 
worker.
 
----------------------------------------------------------------
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: 298915)
    Time Spent: 4h 20m  (was: 4h 10m)

> Streaming Dataflow worker doesn't report FnAPI metrics.
> -------------------------------------------------------
>
>                 Key: BEAM-7969
>                 URL: https://issues.apache.org/jira/browse/BEAM-7969
>             Project: Beam
>          Issue Type: Bug
>          Components: java-fn-execution, runner-dataflow
>            Reporter: Mikhail Gryzykhin
>            Assignee: Mikhail Gryzykhin
>            Priority: Major
>          Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> EOM



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to