Class BytesThroughputEstimator<T>
java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.estimator.BytesThroughputEstimator<T>
- All Implemented Interfaces:
Serializable,ThroughputEstimator<T>
An estimator to provide an estimate on the throughput of the outputted elements.
This estimator will keep track of the bytes of reported records within a sliding window. The
window consists of the configured number of seconds and each record's bytes will fall into
exactly one given second bucket. When more than window size seconds have passed from the current
time, the bytes reported for the seconds that fall of the window will not be considered anymore.
The bytes of the records will be estimated using the configured Coder.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBytesThroughputEstimator(int windowSizeSeconds, SizeEstimator<T> sizeEstimator) -
Method Summary
-
Constructor Details
-
BytesThroughputEstimator
-
-
Method Details
-
update
Updates the estimator with the bytes of records.- Specified by:
updatein interfaceThroughputEstimator<T>- Parameters:
timeOfRecords- the committed timestamp of the recordselement- the element to estimate the byte size of
-
get
public double get()Returns the estimated throughput bytes for now.- Specified by:
getin interfaceThroughputEstimator<T>
-
getFrom
public double getFrom(com.google.cloud.Timestamp time) Returns the estimated throughput bytes for a specified time.- Specified by:
getFromin interfaceThroughputEstimator<T>- Parameters:
time- the specified timestamp to check throughput
-