rohdesamuel commented on code in PR #25354: URL: https://github.com/apache/beam/pull/25354#discussion_r1103248650
########## sdks/java/harness/src/main/java/org/apache/beam/fn/harness/debug/DataSamplingDescriptorModifier.java: ########## @@ -0,0 +1,49 @@ +/* + * 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.fn.harness.debug; + +import org.apache.beam.fn.harness.ProcessBundleDescriptorModifier; +import org.apache.beam.model.fnexecution.v1.BeamFnApi; +import org.apache.beam.model.pipeline.v1.RunnerApi; + +/** + * Modifies the given ProcessBundleDescriptor by adding a DataSampling operation as a consumer to + * every PCollection. + */ +public class DataSamplingDescriptorModifier implements ProcessBundleDescriptorModifier { Review Comment: Redone with atomics: **yes data sampling (no atomics)** Benchmark Mode Cnt Score Error Units ProcessBundleBenchmark.testLargeBundle thrpt 15 1150.680 ± 25.650 ops/s :sdks:java:harness:jmh:jmh (Thread[Execution worker Thread 7,5,main]) completed. Took 5 mins 9.453 secs. **yes data sampling (with atomics)** Benchmark Mode Cnt Score Error Units ProcessBundleBenchmark.testLargeBundle thrpt 15 1547.291 ± 50.887 ops/s :sdks:java:harness:jmh:jmh (Thread[Execution worker Thread 6,5,main]) completed. Took 5 mins 8.804 secs. **no data sampling** Benchmark Mode Cnt Score Error Units ProcessBundleBenchmark.testLargeBundle thrpt 15 1709.427 ± 38.715 ops/s :sdks:java:harness:jmh:jmh (Thread[included builds,5,main]) completed. Took 5 mins 8.804 secs. **At head** Benchmark Mode Cnt Score Error Units ProcessBundleBenchmark.testLargeBundle thrpt 15 1807.738 ± 15.295 ops/s :sdks:java:harness:jmh:jmh (Thread[Execution worker Thread 2,5,main]) completed. Took 5 mins 8.921 secs. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
