Class RateMeasurement
java.lang.Object
io.camunda.zeebe.logstreams.impl.flowcontrol.RateMeasurement
Measures the rate of change for monotonically increasing values.
-
Constructor Summary
ConstructorsConstructorDescriptionRateMeasurement(LongSupplier clock, Duration observationWindow, Duration resolution) -
Method Summary
-
Constructor Details
-
RateMeasurement
-
-
Method Details
-
observe
public boolean observe(long value) Updates the rate measurement with the given value.The new observation will be ignored if it is not the first or measured after the previous at least by the resolution time.
- Parameters:
value- to update the rate measurement with.- Returns:
- true if the observation was added, false if the observation was skipped.
-
rate
public long rate()
-