[
https://issues.apache.org/jira/browse/BEAM-6138?focusedWorklogId=193582&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-193582
]
ASF GitHub Bot logged work on BEAM-6138:
----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Feb/19 00:35
Start Date: 02/Feb/19 00:35
Worklog Time Spent: 10m
Work Description: ajamato commented on pull request #7624: [BEAM-6138]
Set the PTransform name on Java SDK User counters
URL: https://github.com/apache/beam/pull/7624#discussion_r253203172
##########
File path:
runners/core-java/src/test/java/org/apache/beam/runners/core/metrics/MetricsContainerStepMapTest.java
##########
@@ -172,6 +177,44 @@ public void
testGaugeCommittedUnsupportedInAttemptedAccumulatedMetricResults() {
assertGauge(GAUGE_NAME, step1res, STEP1, GaugeResult.empty(), true);
}
+ @Test
+ public void testUpdateAllUpdatesUnboundedAndBoundedContainers() {
+ MetricsContainerStepMap baseMetricContainerRegistry = new
MetricsContainerStepMap();
+
+ CounterCell c1 =
+
baseMetricContainerRegistry.getContainer(STEP1).getCounter(MetricName.named("ns",
"name1"));
+ CounterCell c2 =
+ baseMetricContainerRegistry
+ .getUnboundContainer()
+ .getCounter(MetricName.named("ns", "name2"));
+ c1.inc(7);
+ c2.inc(14);
+
+ MetricsContainerStepMap testObject = new MetricsContainerStepMap();
+ testObject.updateAll(baseMetricContainerRegistry);
+
+ List<MonitoringInfo> expected = new ArrayList<MonitoringInfo>();
+
+ SimpleMonitoringInfoBuilder builder = new SimpleMonitoringInfoBuilder();
+ builder.setUrnForUserMetric("ns", "name1");
+ builder.setPTransformLabel(STEP1);
+ builder.setInt64Value(7);
+ expected.add(builder.build());
+
+ builder = new SimpleMonitoringInfoBuilder();
+ builder.setUrnForUserMetric("ns", "name2");
+ builder.setPTransformLabel("");
Review comment:
Reworked this test to use a non user counter on the unbounded container
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 193582)
Time Spent: 7h 10m (was: 7h)
> 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
> Time Spent: 7h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)