Performance change to option enable client.QPS, client.Burst
and change default on max_requests_inflight.
This commit is contained in:
@@ -61,7 +61,7 @@ type RESTClient struct {
|
||||
// such as Get, Put, Post, and Delete on specified paths. Codec controls encoding and
|
||||
// decoding of responses from the server. If this client should use the older, legacy
|
||||
// API conventions from Kubernetes API v1beta1 and v1beta2, set legacyBehavior true.
|
||||
func NewRESTClient(baseURL *url.URL, apiVersion string, c runtime.Codec, legacyBehavior bool, maxQPS float32) *RESTClient {
|
||||
func NewRESTClient(baseURL *url.URL, apiVersion string, c runtime.Codec, legacyBehavior bool, maxQPS float32, maxBurst int) *RESTClient {
|
||||
base := *baseURL
|
||||
if !strings.HasSuffix(base.Path, "/") {
|
||||
base.Path += "/"
|
||||
@@ -71,7 +71,7 @@ func NewRESTClient(baseURL *url.URL, apiVersion string, c runtime.Codec, legacyB
|
||||
|
||||
var throttle util.RateLimiter
|
||||
if maxQPS > 0 {
|
||||
throttle = util.NewTokenBucketRateLimiter(maxQPS, 10)
|
||||
throttle = util.NewTokenBucketRateLimiter(maxQPS, maxBurst)
|
||||
}
|
||||
return &RESTClient{
|
||||
baseURL: &base,
|
||||
|
Reference in New Issue
Block a user