[
https://issues.apache.org/jira/browse/BEAM-8314?focusedWorklogId=319928&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319928
]
ASF GitHub Bot logged work on BEAM-8314:
----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Sep/19 01:11
Start Date: 28/Sep/19 01:11
Worklog Time Spent: 10m
Work Description: y1chi commented on pull request #9679: [BEAM-8314] Add
aggregation logic to beam_fn_api metric counter updat…
URL: https://github.com/apache/beam/pull/9679#discussion_r329290066
##########
File path:
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/counters/CounterUpdateAggregators.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.dataflow.worker.counters;
+
+import com.google.api.services.dataflow.model.CounterUpdate;
+import com.google.common.collect.ImmutableMap;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import
org.apache.beam.runners.dataflow.worker.MetricsToCounterUpdateConverter.Kind;
+
+public class CounterUpdateAggregators {
+
+ private static final Map<String, CounterUpdateAggregator> aggregators =
+ ImmutableMap.of(
+ Kind.SUM.toString(), new SumCounterUpdateAggregator(),
+ Kind.MEAN.toString(), new MeanCounterUpdateAggregator(),
+ Kind.DISTRIBUTION.toString(), new
DistributionCounterUpdateAggregator());
+
+ private static String getCounterUpdateKind(CounterUpdate counterUpdate) {
+ if (counterUpdate.getStructuredNameAndMetadata() != null
+ && counterUpdate.getStructuredNameAndMetadata().getMetadata() != null)
{
+ return
counterUpdate.getStructuredNameAndMetadata().getMetadata().getKind();
+ }
+ if (counterUpdate.getNameAndKind() != null) {
+ return counterUpdate.getNameAndKind().getKind();
+ }
+ throw new IllegalArgumentException(
+ "CounterUpdate must have either StructuredNameAndMetadata or
NameAndKind.");
+ }
+
+ public static List<CounterUpdate> aggregate(List<CounterUpdate>
counterUpdates) {
Review comment:
done.
----------------------------------------------------------------
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: 319928)
Time Spent: 4h (was: 3h 50m)
> Beam Fn Api metrics piling causes pipeline to stuck after running for a while
> -----------------------------------------------------------------------------
>
> Key: BEAM-8314
> URL: https://issues.apache.org/jira/browse/BEAM-8314
> Project: Beam
> Issue Type: Bug
> Components: runner-dataflow
> Reporter: Yichi Zhang
> Priority: Blocker
> Fix For: 2.16.0
>
> Attachments: E4UaSUhJJKF.png
>
> Time Spent: 4h
> Remaining Estimate: 0h
>
> Seems that in StreamingDataflowWorker we are not able to update the metrics
> fast enough to dataflow service, the piling metrics causes memory usage to
> increase and eventually leads to excessive memory thrashing/GC. And it will
> almost stop the pipeline from processing new items.
>
> !E4UaSUhJJKF.png!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)