apache_beam.io.components.util module

class apache_beam.io.components.util.MovingSum(window_ms, bucket_ms)[source]

Bases: object

Class that keeps track of a rolling window sum.

For use in tracking recent performance of the connector.

Intended to be similar to org.apache.beam.sdk.util.MovingFunction(…, Sum.ofLongs()), but for convenience we expose the count of entries as well so this doubles as a moving average tracker.

sum(now)[source]
add(now, inc)[source]
count(now)[source]
has_data(now)[source]