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

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

                Author: ASF GitHub Bot
            Created on: 03/Dec/19 11:44
            Start Date: 03/Dec/19 11:44
    Worklog Time Spent: 10m 
      Work Description: mxm commented on pull request #10105: [BEAM-4776] Add 
metrics support to Java PortableRunner
URL: https://github.com/apache/beam/pull/10105#discussion_r353130954
 
 

 ##########
 File path: 
runners/core-java/src/test/java/org/apache/beam/runners/core/metrics/MetricsPusherTest.java
 ##########
 @@ -48,18 +48,35 @@
   private static final Logger LOG = 
LoggerFactory.getLogger(MetricsPusherTest.class);
 
   private static final long NUM_ELEMENTS = 1000L;
+  private static final String COUNTER_NAME = "counter";
   @Rule public final TestPipeline pipeline = TestPipeline.create();
 
   @Before
   public void init() {
-    TestMetricsSink.clear();
     MetricsOptions options = pipeline.getOptions().as(MetricsOptions.class);
     options.setMetricsSink(TestMetricsSink.class);
   }
 
   @Category({ValidatesRunner.class, UsesAttemptedMetrics.class, 
UsesCounterMetrics.class})
   @Test
-  public void test() throws Exception {
+  public void pushesUserMetrics() throws Exception {
+    TestMetricsSink.clear();
+    pipeline
+        .apply(
+            // Use maxReadTime to force unbounded mode.
+            
GenerateSequence.from(0).to(NUM_ELEMENTS).withMaxReadTime(Duration.standardDays(1)))
+        .apply(ParDo.of(new CountingDoFn()));
+    pipeline.run();
+    // give metrics pusher time to push
+    Thread.sleep(
+        (pipeline.getOptions().as(MetricsOptions.class).getMetricsPushPeriod() 
+ 1L) * 1000);
 
 Review comment:
   We should probably lower this interval and build in a retry logic. Otherwise 
this is prone to breaking.
 
----------------------------------------------------------------
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: 352566)
    Time Spent: 12h 40m  (was: 12.5h)

> Java PortableRunner should support metrics
> ------------------------------------------
>
>                 Key: BEAM-4776
>                 URL: https://issues.apache.org/jira/browse/BEAM-4776
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-core
>            Reporter: Eugene Kirpichov
>            Assignee: Michal Walenia
>            Priority: Major
>             Fix For: 2.18.0
>
>          Time Spent: 12h 40m
>  Remaining Estimate: 0h
>
> BEAM-4775 concerns adding metrics to the JobService API; the current issue is 
> about making PortableRunner understand them.



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

Reply via email to