[
https://issues.apache.org/jira/browse/BEAM-4776?focusedWorklogId=350441&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-350441
]
ASF GitHub Bot logged work on BEAM-4776:
----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Nov/19 14:49
Start Date: 27/Nov/19 14:49
Worklog Time Spent: 10m
Work Description: mwalenia commented on pull request #10105: [BEAM-4776]
Add metrics support to Java PortableRunner
URL: https://github.com/apache/beam/pull/10105#discussion_r351329941
##########
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);
+ assertThat(TestMetricsSink.getCounterValue(COUNTER_NAME),
is(NUM_ELEMENTS));
+ }
+
+ @Category({ValidatesRunner.class, UsesAttemptedMetrics.class,
UsesCounterMetrics.class})
+ @Test
+ public void pushesSystemMetrics() throws InterruptedException {
Review comment:
@echauchot I added a test that checks if system metrics are supported by
MetricPusher. It seems that they work :)
I also fixed the TestMetricsSink to account for this fact.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 350441)
Time Spent: 9.5h (was: 9h 20m)
> 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
> Time Spent: 9.5h
> 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)