m-trieu commented on code in PR #30795:
URL: https://github.com/apache/beam/pull/30795#discussion_r1560066045
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/harness/StreamingWorkerStatusReporter.java:
##########
@@ -81,6 +83,12 @@ public final class StreamingWorkerStatusReporter {
private final ScheduledExecutorService globalWorkerUpdateReporter;
private final ScheduledExecutorService workerMessageReporter;
+ // PerWorkerMetrics are sent on the WorkerMessages channel, and are sent one
in every
+ // perWorkerMetricsUpdateFrequency RPC call. If 0, PerWorkerMetrics are not
reported.
+ long perWorkerMetricsUpdateFrequency = 0L;
+ // Used to track the number of WorkerMessages that have been sent without
PerWorkerMetrics.
+ long workerMessagesIndex = 0L;
Review Comment:
this will not be threadsafe, how about using an AtomicLong
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/harness/StreamingWorkerStatusReporter.java:
##########
@@ -81,6 +83,12 @@ public final class StreamingWorkerStatusReporter {
private final ScheduledExecutorService globalWorkerUpdateReporter;
private final ScheduledExecutorService workerMessageReporter;
+ // PerWorkerMetrics are sent on the WorkerMessages channel, and are sent one
in every
+ // perWorkerMetricsUpdateFrequency RPC call. If 0, PerWorkerMetrics are not
reported.
+ long perWorkerMetricsUpdateFrequency = 0L;
Review Comment:
if this never changes lets make it private and final and initialize in the
constructor
you can modify the constructor to take in this instead of passing it into
start() and have start() take no params.
--
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]