-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: introduce WithQPS and WithBurst functions #262
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thapabishwa thank you for pointing it out. change lgtm 🚀 I have added couple of comments
fmt.Println("kubeconfig QPS:", kubeConfig.QPS) | ||
fmt.Println("kubeconfig Burst:", kubeConfig.Burst) | ||
|
||
// kubeConfig.QPS = 2000 | ||
// kubeConfig.Burst = 2000 | ||
/* uncomment the above lines to manually set QPS and Burst | ||
after manually setting QPS and Burst, your response time will be much faster | ||
|
||
example output with WithQPS(2000) and WithBurst(2000) functions: | ||
Setting burst to 2000 | ||
Setting QPS to 2000 | ||
kubeconfig QPS: 0 (qps and burst are reset to 0) | ||
kubeconfig Burst: 0 | ||
Current namespace: default | ||
Scanning cluster | ||
Time taken: 2.057551041s | ||
Name: coredns, Kind: Deployment, Namespace: kube-system, Images: [registry.k8s.io/coredns/coredns:v1.10.1] | ||
|
||
example output after manually setting QPS and Burst: | ||
Setting burst to 2000 | ||
Setting QPS to 2000 | ||
kubeconfig QPS: 2000 (manually set values) | ||
kubeconfig Burst: 2000 (manually set values) | ||
Current namespace: default | ||
Scanning cluster | ||
Time taken: 89.546083ms | ||
Name: coredns, Kind: Deployment, Namespace: kube-system, Images: [registry.k8s.io/coredns/coredns:v1.10.1] | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for example , I think this comment can be removed
@@ -139,6 +139,21 @@ func WithKubeConfig(kubeConfig string) ClusterOption { | |||
} | |||
} | |||
|
|||
func WithQPS(qps float32) ClusterOption { | |||
return func(o *genericclioptions.ConfigFlags) { | |||
fmt.Println("Setting QPS to", qps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fmt.Println
can be removed
// WithBurst sets the burst limit for the client | ||
func WithBurst(burst int) ClusterOption { | ||
return func(o *genericclioptions.ConfigFlags) { | ||
fmt.Println("Setting burst to", burst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fmt.Println
can be removed
d68c121
to
ec2224b
Compare
@chen-keinan
Unfortunately I couldn't create an issue on this repo like we discussed.
As such, I have created this PR to reflect the changes that I made on my end to while I encountered the issue.
I believe that might help you to pin point the issue.