[
https://issues.apache.org/jira/browse/BEAM-6597?focusedWorklogId=581285&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-581285
]
ASF GitHub Bot logged work on BEAM-6597:
----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Apr/21 19:41
Start Date: 12/Apr/21 19:41
Worklog Time Spent: 10m
Work Description: robertwb commented on a change in pull request #14482:
URL: https://github.com/apache/beam/pull/14482#discussion_r611904721
##########
File path:
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/control/ProcessBundleHandler.java
##########
@@ -369,29 +371,46 @@ private void
createRunnerAndConsumersForPTransformRecursively(
.setProcessBundleProgress(BeamFnApi.ProcessBundleProgressResponse.getDefaultInstance());
}
- // TODO(BEAM-6597): This should really only be reporting monitoring infos
where the data
- // changed
- // and we should be using the short id system.
+ Map<String, ByteString> monitoringData = monitoringData(bundleProcessor);
+ if (runnerAcceptsShortIds) {
+ response.putAllMonitoringData(monitoringData);
+ } else {
+ for (Map.Entry<String, ByteString> metric :
response.getMonitoringDataMap().entrySet()) {
+ response.addMonitoringInfos(
+
shortIds.get(metric.getKey()).toBuilder().setPayload(metric.getValue()));
+ }
+ }
+ return
BeamFnApi.InstructionResponse.newBuilder().setProcessBundleProgress(response);
+ }
+
+ private ImmutableMap<String, ByteString> monitoringData(BundleProcessor
bundleProcessor)
+ throws Exception {
+ ImmutableMap.Builder<String, ByteString> result = ImmutableMap.builder();
// Get start bundle Execution Time Metrics.
- response.addAllMonitoringInfos(
-
bundleProcessor.getStartFunctionRegistry().getExecutionTimeMonitoringInfos());
+ result.putAll(
+
bundleProcessor.getStartFunctionRegistry().getExecutionTimeMonitoringData(shortIds));
// Get process bundle Execution Time Metrics.
- response.addAllMonitoringInfos(
-
bundleProcessor.getpCollectionConsumerRegistry().getExecutionTimeMonitoringInfos());
+ result.putAll(
+
bundleProcessor.getpCollectionConsumerRegistry().getExecutionTimeMonitoringData(shortIds));
// Get finish bundle Execution Time Metrics.
- response.addAllMonitoringInfos(
-
bundleProcessor.getFinishFunctionRegistry().getExecutionTimeMonitoringInfos());
- // Extract all other MonitoringInfos other than the execution time
monitoring infos.
- response.addAllMonitoringInfos(
- bundleProcessor.getMetricsContainerRegistry().getMonitoringInfos());
+ result.putAll(
+
bundleProcessor.getFinishFunctionRegistry().getExecutionTimeMonitoringData(shortIds));
+ // Extract MonitoringInfos that come from the metrics container registry.
+
result.putAll(bundleProcessor.getMetricsContainerRegistry().getMonitoringData(shortIds));
// Add any additional monitoring infos that the "runners" report
explicitly.
for (ProgressRequestCallback progressRequestCallback :
bundleProcessor.getProgressRequestCallbacks()) {
-
response.addAllMonitoringInfos(progressRequestCallback.getMonitoringInfos());
+ // TODO(BEAM-6597): This should be reporting monitoring infos using the
short id system.
Review comment:
This is about pushing it further upstream (not high priority).
Clarified.
--
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: 581285)
Time Spent: 2h 20m (was: 2h 10m)
> Put MonitoringInfos/metrics in the Java SDK ProcessBundleProgressResponse
> -------------------------------------------------------------------------
>
> Key: BEAM-6597
> URL: https://issues.apache.org/jira/browse/BEAM-6597
> Project: Beam
> Issue Type: New Feature
> Components: java-fn-execution
> Reporter: Alex Amato
> Assignee: Luke Cwik
> Priority: P2
> Fix For: 2.21.0
>
> Time Spent: 2h 20m
> Remaining Estimate: 0h
>
> I think this is the correct approach, as I don't believe there is any hook in
> the Java SDK yet for ProcessBundleProgressResponses.
> (1) Implement ProcessBundleProgressResponse
> See FnHarness.main to add a handle for RequestCase.PROGRESS_BUNDLE.
> (2) Refactor ProgressBundleHandler so that the metrics can be extracted from
> the MetricContainerStep map and SimpleExecutionStates for the instrucitonId
> when the call comes in. (Right now all these objects only live in the local
> function, they may need to live in an object instead which can be accessed by
> both process bundle and progress bundle responses). Be careful to not
> introduce thread contention. Ideally we need a way to read the values without
> locking new ones from being written.
> (Test 1) Also be sure to simplify RemoteExecutionTest.testMetrics().
> By inspecting the metric progress, we can remove the sleeps from this code.
> Currently there are sleeps in start, process and finish to ensure execution
> time metrics are added. Instead, once progress bundle responses are
> introduced, the metrics can be examined here
--
This message was sent by Atlassian Jira
(v8.3.4#803005)