Class FlowControlEventStats (2.31.1)

public class FlowControlEventStats

Record the statistics of flow control events.

This class is populated by FlowController, which will record throttling events. Currently it only keeps the last flow control event, but it could be expanded to record more information in the future. The events can be used to dynamically adjust concurrency in the client. For example:


 // Increase flow control limits if there was throttling in the past 5 minutes and throttled time
 // was longer than 1 minute.
 while(true) {
    FlowControlEvent event = flowControlEventStats.getLastFlowControlEvent();
    if (event != null
         && event.getTimestampMs() > System.currentMillis() - TimeUnit.MINUTES.toMillis(5)
         && event.getThrottledTimeInMs() > TimeUnit.MINUTES.toMillis(1)) {
      flowController.increaseThresholds(elementSteps, byteSteps);
    }
    Thread.sleep(TimeUnit.MINUTE.toMillis(10));
 }
 

Inheritance

java.lang.Object > FlowControlEventStats

Constructors

FlowControlEventStats()

public FlowControlEventStats()

Methods

getLastFlowControlEvent()

public FlowControlEventStats.FlowControlEvent getLastFlowControlEvent()
Returns
TypeDescription
FlowControlEventStats.FlowControlEvent