Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9cdbbe0

Browse files
pab-googpabloem
authored andcommitted
Adding flag to mask change
1 parent 22f5a81 commit 9cdbbe0

5 files changed

Lines changed: 6 additions & 22 deletions

File tree

sdks/python/apache_beam/runners/worker/operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def _read_side_inputs(self, tags_and_types):
325325
sources.append(si.source)
326326
# The tracking of time spend reading and bytes read from side inputs is
327327
# behind an experiment flag to test its performance impact.
328-
if 'sideinput_io_metrics' in RuntimeValueProvider.experiments:
328+
if 'sideinput_io_metrics_v2' in RuntimeValueProvider.experiments:
329329
si_counter = opcounters.SideInputReadCounter(
330330
self.counter_factory,
331331
self.state_sampler,

sdks/python/apache_beam/runners/worker/sideinputs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __init__(self,
8080
def add_byte_counter(self, reader):
8181
"""Adds byte counter observer to a side input reader.
8282
83-
If the 'sideinput_io_metrics' experiment flag is not passed in, then
83+
If the 'sideinput_io_metrics_v2' experiment flag is not passed in, then
8484
nothing is attached to the reader.
8585
8686
Args:
@@ -123,7 +123,7 @@ def _reader_thread(self):
123123
# The tracking of time spend reading and bytes read from side
124124
# inputs is kept behind an experiment flag to test performance
125125
# impact.
126-
if 'sideinput_io_metrics' in RuntimeValueProvider.experiments:
126+
if 'sideinput_io_metrics_v2' in RuntimeValueProvider.experiments:
127127
self.add_byte_counter(reader)
128128
returns_windowed_values = reader.returns_windowed_values
129129
for value in reader:

sdks/python/apache_beam/runners/worker/sideinputs_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_bytes_read_behind_experiment(self):
9292

9393
def test_bytes_read_are_reported(self):
9494
RuntimeValueProvider.set_runtime_options(
95-
{'experiments': ['sideinput_io_metrics', 'other']})
95+
{'experiments': ['sideinput_io_metrics_v2', 'other']})
9696
mock_read_counter = mock.MagicMock()
9797
source_records = ['a', 'b', 'c', 'd']
9898
sources = [

sdks/python/apache_beam/runners/worker/statesampler_fast.pxd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ from libc.stdint cimport int32_t, int64_t
2525
cdef class StateSampler(object):
2626
"""Tracks time spent in states during pipeline execution."""
2727
cdef int _sampling_period_ms
28+
cdef int _sampling_period_ms_start
29+
cdef double _sampling_period_ratio
2830

2931
cdef list scoped_states_by_index
3032

sdks/python/apache_beam/runners/worker/statesampler_fast.pyx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,6 @@ cdef inline int64_t get_nsec_time() nogil:
7171

7272
cdef class StateSampler(object):
7373
"""Tracks time spent in states during pipeline execution."""
74-
cdef int _sampling_period_ms
75-
cdef int _sampling_period_ms_start
76-
cdef double _sampling_period_ratio
77-
78-
cdef list scoped_states_by_index
79-
80-
cdef public bint started
81-
cdef public bint finished
82-
cdef object sampling_thread
83-
84-
# This lock guards members that are shared between threads, specificaly
85-
# finished, scoped_states_by_index, and the nsecs field of each state therein.
86-
cdef pythread.PyThread_type_lock lock
87-
88-
cdef public int64_t state_transition_count
89-
cdef public int64_t time_since_transition
90-
91-
cdef int32_t current_state_index
9274

9375
def __init__(self,
9476
sampling_period_ms,

0 commit comments

Comments
 (0)