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

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

                Author: ASF GitHub Bot
            Created on: 30/Jun/21 01:43
            Start Date: 30/Jun/21 01:43
    Worklog Time Spent: 10m 
      Work Description: ajamato commented on a change in pull request #14805:
URL: https://github.com/apache/beam/pull/14805#discussion_r661066146



##########
File path: 
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnHarness.java
##########
@@ -262,6 +265,8 @@ public static void main(
                     }
                   });
 
+      MetricsEnvironment.setProcessWideContainer(new MetricsContainerImpl());

Review comment:
       Okay, I looked into this a bit more. And I don't think that I can set 
the MetricContainerInmpl as the default container in MetricsEnvironment without 
adding a bad dependency, which I think may introduce a cycle.
   
   As intellij seems to want to add the dependency when I try to instantiate 
the MetricsContainerImpl in MetricsEnvironment.
   I dont think we can add a dep in this direction. (Today, MetricsEnvironment 
only depends on the interface MetricsContainer).
   
   
sdks/java/core/src/main/java/org/apache/beam/sdk/metrics/MetricsEnvironment.java
   
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/MetricsContainerImpl.java
   
   That is, we don't make the sdk/java/core depend on the runners/core-java.
   The way it works today is because we allow sdks/java/harness to depend on 
runners/core-java.
   
   which is why we can instantiate it in 
   sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnHarness.java
   
   Some larger refactor may make this possible, but I feel its unclear what 
would be the best choice here and would be too big a refactor for this PR

##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/MetricsContainerImpl.java
##########
@@ -84,9 +86,22 @@
   private MetricsMap<KV<MetricName, HistogramData.BucketType>, HistogramCell> 
histograms =
       new MetricsMap<>(HistogramCell::new);
 
-  /** Create a new {@link MetricsContainerImpl} associated with the given 
{@code stepName}. */
+  /**
+   * Create a new {@link MetricsContainerImpl} associated with the given 
{@code stepName}. If
+   * stepName is null, this MetricsContainer is not bound to a step.

Review comment:
       Added MetricsContainerImpl.createProcessWideContainer()




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 616862)
    Time Spent: 20h 20m  (was: 20h 10m)

> Java BigQuery - Implement IO Request Count metrics
> --------------------------------------------------
>
>                 Key: BEAM-11994
>                 URL: https://issues.apache.org/jira/browse/BEAM-11994
>             Project: Beam
>          Issue Type: Test
>          Components: io-java-gcp
>            Reporter: Alex Amato
>            Assignee: Alex Amato
>            Priority: P2
>          Time Spent: 20h 20m
>  Remaining Estimate: 0h
>
> Reference PRs (See BigQuery IO example) and detailed explanation of what's 
> needed to instrument this IO with Request Count metrics is found in this 
> handoff doc:
> [https://docs.google.com/document/d/1lrz2wE5Dl4zlUfPAenjXIQyleZvqevqoxhyE85aj4sc/edit'|https://docs.google.com/document/d/1lrz2wE5Dl4zlUfPAenjXIQyleZvqevqoxhyE85aj4sc/edit'?authuser=0]



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

Reply via email to