Skip to content

Commit de55c54

Browse files
authored
Merge pull request #983 from googs1025/feature/add_qps_burst
chore: qps flag: use float32 instead of float64
2 parents 8b2ff03 + 0d756b7 commit de55c54

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmd/options/options.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type NodeProblemDetectorOptions struct {
4444
// ServerAddress is the address to bind the node problem detector server.
4545
ServerAddress string
4646
// QPS is the maximum QPS to the master from client.
47-
QPS float64
47+
QPS float32
4848
// Burst is the maximum burst for throttle.
4949
Burst int
5050

@@ -129,8 +129,8 @@ func (npdo *NodeProblemDetectorOptions) AddFlags(fs *pflag.FlagSet) {
129129
20257, "The port to bind the Prometheus scrape endpoint. Prometheus exporter is enabled by default at port 20257. Use 0 to disable.")
130130
fs.StringVar(&npdo.PrometheusServerAddress, "prometheus-address",
131131
"127.0.0.1", "The address to bind the Prometheus scrape endpoint.")
132-
flag.Float64Var(&npdo.QPS, "kube-api-qps", 500, "Maximum QPS to use while talking with Kubernetes API")
133-
flag.IntVar(&npdo.Burst, "kube-api-burst", 500, "Maximum burst for throttle while talking with Kubernetes API")
132+
fs.Float32Var(&npdo.QPS, "kube-api-qps", 500, "Maximum QPS to use while talking with Kubernetes API")
133+
fs.IntVar(&npdo.Burst, "kube-api-burst", 500, "Maximum burst for throttle while talking with Kubernetes API")
134134
for _, exporterName := range exporters.GetExporterNames() {
135135
exporterHandler := exporters.GetExporterHandlerOrDie(exporterName)
136136
exporterHandler.Options.SetFlags(fs)

pkg/exporters/k8sexporter/problemclient/problem_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func NewClientOrDie(npdo *options.NodeProblemDetectorOptions) Client {
7474
}
7575

7676
cfg.UserAgent = fmt.Sprintf("%s/%s", filepath.Base(os.Args[0]), version.Version())
77-
cfg.QPS = float32(npdo.QPS)
77+
cfg.QPS = npdo.QPS
7878
cfg.Burst = npdo.Burst
7979
c.client = clientset.NewForConfigOrDie(cfg).CoreV1()
8080
c.nodeName = npdo.NodeName

0 commit comments

Comments
 (0)