MCPcopy
hub / github.com/IBM/sarama / handleThrottledResponse

Method handleThrottledResponse

broker.go:1922–1935  ·  view source on GitHub ↗
(resp protocolBody)

Source from the content-addressed store, hash-verified

1920}
1921
1922func (b *Broker) handleThrottledResponse(resp protocolBody) {
1923 throttledResponse, ok := resp.(throttleSupport)
1924 if !ok {
1925 return
1926 }
1927 throttleTime := throttledResponse.throttleTime()
1928 if throttleTime == time.Duration(0) {
1929 return
1930 }
1931 DebugLogger.Printf(
1932 "broker/%d %T throttled %v\n", b.ID(), resp, throttleTime)
1933 b.setThrottle(throttleTime)
1934 b.updateThrottleMetric(throttleTime)
1935}
1936
1937func (b *Broker) setThrottle(throttleTime time.Duration) {
1938 b.throttleTimerLock.Lock()

Callers 5

AsyncProduceMethod · 0.95
sendAndReceiveMethod · 0.95
flushToBrokerMethod · 0.80
ListOffsetsMethod · 0.80

Calls 5

IDMethod · 0.95
setThrottleMethod · 0.95
updateThrottleMetricMethod · 0.95
throttleTimeMethod · 0.65
PrintfMethod · 0.65

Tested by 1