[
https://issues.apache.org/jira/browse/BEAM-6138?focusedWorklogId=226980&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-226980
]
ASF GitHub Bot logged work on BEAM-6138:
----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Apr/19 22:44
Start Date: 12/Apr/19 22:44
Worklog Time Spent: 10m
Work Description: Ardagan commented on pull request #8280: [BEAM-6138]
Update java SDK to report user distribution tuple metrics over the FN API
URL: https://github.com/apache/beam/pull/8280#discussion_r275084353
##########
File path:
runners/core-java/src/test/java/org/apache/beam/runners/core/metrics/MetricsContainerImplTest.java
##########
@@ -178,6 +178,34 @@ public void
testMonitoringInfosArePopulatedForUserCounters() {
assertThat(actualMonitoringInfos, containsInAnyOrder(builder1.build(),
builder2.build()));
}
+ @Test
+ public void testMonitoringInfosArePopulatedForUserDistributions() {
+ MetricsContainerImpl testObject = new MetricsContainerImpl("step1");
+ DistributionCell c1 = testObject.getDistribution(MetricName.named("ns",
"name1"));
+ DistributionCell c2 = testObject.getDistribution(MetricName.named("ns",
"name2"));
+ c1.update(5L);
+ c2.update(4L);
+
+ SimpleMonitoringInfoBuilder builder1 = new SimpleMonitoringInfoBuilder();
+ builder1.setUrnForUserDistribution("ns", "name1");
+ builder1.setInt64DistributionValue(DistributionData.create(5, 1, 5, 5));
+ builder1.setPTransformLabel("step1");
+ builder1.build();
Review comment:
No need to call build() here and next initialization. You do it at L206.
Also it is not required since you're ignoring return value.
----------------------------------------------------------------
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: 226980)
Time Spent: 8h 50m (was: 8h 40m)
> Add User Metric Support to Java SDK
> -----------------------------------
>
> Key: BEAM-6138
> URL: https://issues.apache.org/jira/browse/BEAM-6138
> Project: Beam
> Issue Type: New Feature
> Components: java-fn-execution
> Reporter: Alex Amato
> Assignee: Alex Amato
> Priority: Major
> Labels: triaged
> Time Spent: 8h 50m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)