scwhittle commented on code in PR #23333:
URL: https://github.com/apache/beam/pull/23333#discussion_r988770602
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java:
##########
@@ -1197,13 +1201,25 @@ public State getState() {
}
public void setState(State state) {
+ Instant now = Instant.now();
+ Duration stateDuration = new Duration(this.stateStartTime, now);
+ Duration previousStateDuration = totalDurations.getOrDefault(this.state,
Duration.ZERO);
+ totalDurations.put(this.state,
stateDuration.plus(previousStateDuration));
Review Comment:
nit: could use compute to avoid double lookup
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]