Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 172bc1b

Browse files
committed
Remove perf regression in not yet finished size estimation code
----Release Notes---- [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=120245168
1 parent 13efcdd commit 172bc1b

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

google/cloud/dataflow/worker/opcounters.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
from __future__ import absolute_import
1818

19-
from google.cloud.dataflow.utils.counters import Accumulator
2019
from google.cloud.dataflow.utils.counters import Counter
2120

2221

@@ -29,13 +28,11 @@ def __init__(self, counter_factory, step_name, coder, output_index):
2928
self.mean_byte_counter = counter_factory.get_counter(
3029
'%s-out%d-MeanByteCount' % (step_name, output_index), Counter.MEAN)
3130
self.coder = coder
32-
self._active_accumulators = []
3331

3432
def update_from(self, windowed_value, coder=None):
3533
"""Add one value to this counter."""
3634
self.element_counter.update(1)
37-
byte_size_accumulator = Accumulator(self.mean_byte_counter.name)
38-
self._active_accumulators.append(byte_size_accumulator)
35+
# TODO(silviuc): Implement estimated size sampling.
3936
# TODO(gildea):
4037
# Actually compute the encoded size of this value.
4138
# In spirit, something like this:
@@ -50,9 +47,8 @@ def update_collect(self):
5047
Now that the element has been processed, we ask our accumulator
5148
for the total and store the result in a counter.
5249
"""
53-
for pending in self._active_accumulators:
54-
self.mean_byte_counter.update(pending.total)
55-
self._active_accumulators = []
50+
# TODO(silviuc): Implement estimated size sampling.
51+
pass
5652

5753
def __str__(self):
5854
return '<%s [%s]>' % (self.__class__.__name__,

0 commit comments

Comments
 (0)