Skip to content

Commit

Permalink
add cpuProfile option
Browse files Browse the repository at this point in the history
Signed-off-by: Blake Devcich <[email protected]>
  • Loading branch information
bdevcich committed Nov 30, 2023
1 parent 9c7d43c commit 04eae47
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions daemons/compute/server/servers/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,26 @@ type ServerOptions struct {
tokenFile string
certFile string

name string
nodeName string
sysConfig string
simulated bool
name string
nodeName string
sysConfig string
cpuProfile string
simulated bool

k8sQPS int
k8sBurst int
}

func GetOptions() (*ServerOptions, error) {
opts := ServerOptions{
host: os.Getenv("KUBERNETES_SERVICE_HOST"),
port: os.Getenv("KUBERNETES_SERVICE_PORT"),
name: os.Getenv("NODE_NAME"),
nodeName: os.Getenv("NNF_NODE_NAME"),
tokenFile: os.Getenv("NNF_DATA_MOVEMENT_SERVICE_TOKEN_FILE"),
certFile: os.Getenv("NNF_DATA_MOVEMENT_SERVICE_CERT_FILE"),
simulated: false,
host: os.Getenv("KUBERNETES_SERVICE_HOST"),
port: os.Getenv("KUBERNETES_SERVICE_PORT"),
name: os.Getenv("NODE_NAME"),
nodeName: os.Getenv("NNF_NODE_NAME"),
tokenFile: os.Getenv("NNF_DATA_MOVEMENT_SERVICE_TOKEN_FILE"),
certFile: os.Getenv("NNF_DATA_MOVEMENT_SERVICE_CERT_FILE"),
cpuProfile: os.Getenv("NNF_DATA_MOVEMENT_SERVICE_CPU_PROFILE"),
simulated: false,

// These options adjust the client-side rate-limiting for k8s. The new defaults are 50 and
// 100 (rather than 5, 10). See more info https://github.com/kubernetes/kubernetes/pull/116121
Expand All @@ -68,6 +70,7 @@ func GetOptions() (*ServerOptions, error) {
flag.BoolVar(&opts.simulated, "simulated", opts.simulated, "Run in simulation mode where no requests are sent to the server")
flag.IntVar(&opts.k8sQPS, "kubernetes-qps", opts.k8sQPS, "Kubernetes client queries per second (QPS)")
flag.IntVar(&opts.k8sBurst, "kubernetes-burst", opts.k8sBurst, "Kubernetes client additional concurrent calls above QPS")
flag.StringVar(&opts.cpuProfile, "cpu-profile", opts.cpuProfile, "Enable and dump CPU profiling data to this file")
flag.Parse()
return &opts, nil
}
Expand Down

0 comments on commit 04eae47

Please sign in to comment.