Skip to content

Commit

Permalink
Add iterations-per-namespace as cli option (kube-burner#362)
Browse files Browse the repository at this point in the history
This commit adds namespaced-iterations and iterations-per-namespace
cli options to configure namespacedIterations and iterationsPerNamespace
respectively for node-density-cni and node-density-heavy workloads
  • Loading branch information
venkataanil authored Jul 12, 2023
1 parent 910b286 commit e4e7259
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
jobIterations: {{.JOB_ITERATIONS}}
qps: {{.QPS}}
burst: {{.BURST}}
namespacedIterations: true
iterationsPerNamespace: 1000
namespacedIterations: {{.NAMESPACED_ITERATIONS}}
iterationsPerNamespace: {{.ITERATIONS_PER_NAMESPACE}}
podWait: false
waitWhenFinished: true
preLoadImages: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
jobIterations: {{.JOB_ITERATIONS}}
qps: {{.QPS}}
burst: {{.BURST}}
namespacedIterations: true
iterationsPerNamespace: 1000
namespacedIterations: {{.NAMESPACED_ITERATIONS}}
iterationsPerNamespace: {{.ITERATIONS_PER_NAMESPACE}}
podWait: false
waitWhenFinished: true
preLoadImages: true
Expand Down
6 changes: 6 additions & 0 deletions pkg/workloads/node-density-cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
// NewNodeDensity holds node-density-cni workload
func NewNodeDensityCNI(wh *WorkloadHelper) *cobra.Command {
var podsPerNode int
var namespacedIterations bool
var iterationsPerNamespace int
cmd := &cobra.Command{
Use: "node-density-cni",
Short: "Runs node-density-cni workload",
Expand All @@ -38,11 +40,15 @@ func NewNodeDensityCNI(wh *WorkloadHelper) *cobra.Command {
log.Fatal(err)
}
os.Setenv("JOB_ITERATIONS", fmt.Sprint((totalPods-podCount)/2))
os.Setenv("NAMESPACED_ITERATIONS", fmt.Sprint(namespacedIterations))
os.Setenv("ITERATIONS_PER_NAMESPACE", fmt.Sprint(iterationsPerNamespace))
},
Run: func(cmd *cobra.Command, args []string) {
wh.run(cmd.Name(), MetricsProfileMap[cmd.Name()])
},
}
cmd.Flags().IntVar(&podsPerNode, "pods-per-node", 245, "Pods per node")
cmd.Flags().BoolVar(&namespacedIterations, "namespaced-iterations", true, "Namespaced iterations")
cmd.Flags().IntVar(&iterationsPerNamespace, "iterations-per-namespace", 1000, "Iterations per namespace")
return cmd
}
6 changes: 6 additions & 0 deletions pkg/workloads/node-density-heavy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (
func NewNodeDensityHeavy(wh *WorkloadHelper) *cobra.Command {
var podsPerNode int
var podReadyThreshold, probesPeriod time.Duration
var namespacedIterations bool
var iterationsPerNamespace int
cmd := &cobra.Command{
Use: "node-density-heavy",
Short: "Runs node-density-heavy workload",
Expand All @@ -43,6 +45,8 @@ func NewNodeDensityHeavy(wh *WorkloadHelper) *cobra.Command {
os.Setenv("JOB_ITERATIONS", fmt.Sprint((totalPods-podCount)/2))
os.Setenv("POD_READY_THRESHOLD", fmt.Sprintf("%v", podReadyThreshold))
os.Setenv("PROBES_PERIOD", fmt.Sprint(probesPeriod.Seconds()))
os.Setenv("NAMESPACED_ITERATIONS", fmt.Sprint(namespacedIterations))
os.Setenv("ITERATIONS_PER_NAMESPACE", fmt.Sprint(iterationsPerNamespace))
},
Run: func(cmd *cobra.Command, args []string) {
wh.run(cmd.Name(), MetricsProfileMap[cmd.Name()])
Expand All @@ -51,5 +55,7 @@ func NewNodeDensityHeavy(wh *WorkloadHelper) *cobra.Command {
cmd.Flags().DurationVar(&podReadyThreshold, "pod-ready-threshold", 1*time.Hour, "Pod ready timeout threshold")
cmd.Flags().DurationVar(&probesPeriod, "probes-period", 10*time.Second, "Perf app readiness/livenes probes period")
cmd.Flags().IntVar(&podsPerNode, "pods-per-node", 245, "Pods per node")
cmd.Flags().BoolVar(&namespacedIterations, "namespaced-iterations", true, "Namespaced iterations")
cmd.Flags().IntVar(&iterationsPerNamespace, "iterations-per-namespace", 1000, "Iterations per namespace")
return cmd
}

0 comments on commit e4e7259

Please sign in to comment.