Performance change to option enable client.QPS, client.Burst

and change default on max_requests_inflight.
This commit is contained in:
Timothy St. Clair
2015-04-09 12:12:52 -05:00
parent 8510fc67ff
commit 2b60111fca
10 changed files with 42 additions and 7 deletions

View File

@@ -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,