JayajP commented on code in PR #30245:
URL: https://github.com/apache/beam/pull/30245#discussion_r1488269199


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/StageInfo.java:
##########
@@ -117,6 +119,24 @@ public List<PerStepNamespaceMetrics> 
extractPerWorkerMetricValues() {
     Iterables.addAll(
         metrics,
         
StreamingStepMetricsContainer.extractPerWorkerMetricUpdates(metricsContainerRegistry()));
+    translateKnownPerWorkerCounters(metrics);
     return metrics;
   }
+
+  private void translateKnownPerWorkerCounters(List<PerStepNamespaceMetrics> 
metrics) {
+    for (PerStepNamespaceMetrics perStepnamespaceMetrics : metrics) {
+      if (!BigQuerySinkMetrics.METRICS_NAMESPACE.equals(
+          perStepnamespaceMetrics.getMetricsNamespace())) {
+        continue;
+      }
+      for (MetricValue metric : perStepnamespaceMetrics.getMetricValues()) {
+        if (BigQuerySinkMetrics.THROTTLED_TIME.equals(metric.getMetric())) {
+          Long msecs = metric.getValueInt64();

Review Comment:
   Leaving this as is.
   `getValueInt64` returns a Long, but it's possible - though unexpected - for 
the function to return null.
   
   Added a test case to cover this case. 



-- 
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]

Reply via email to