Skip to content

Commit

Permalink
Pod latency threshold flag for all cluster-density and node-density w…
Browse files Browse the repository at this point in the history
…o… (kube-burner#487)

* Pod latency threshold flag for all cluster-density and node-density workloads

Signed-off-by: Raul Sevilla <[email protected]>

---------

Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 authored Nov 10, 2023
1 parent 3b168fd commit b1350f8
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ global:
type: {{.INDEXING_TYPE}}
measurements:
- name: podLatency
thresholds:
- conditionType: Ready
metric: P99
threshold: {{.POD_READY_THRESHOLD}}
jobs:
- name: cluster-density-ms
namespace: cluster-density-ms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ global:
type: {{.INDEXING_TYPE}}
measurements:
- name: podLatency
thresholds:
- conditionType: Ready
metric: P99
threshold: {{.POD_READY_THRESHOLD}}
jobs:
- name: cluster-density-v2
namespace: cluster-density-v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ global:
type: {{.INDEXING_TYPE}}
measurements:
- name: podLatency
thresholds:
- conditionType: Ready
metric: P99
threshold: {{.POD_READY_THRESHOLD}}
jobs:
- name: cluster-density
namespace: cluster-density
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ global:
type: {{.INDEXING_TYPE}}
measurements:
- name: podLatency
thresholds:
- conditionType: Ready
metric: P99
threshold: {{.POD_READY_THRESHOLD}}
jobs:
- name: node-density-cni
namespace: node-density-cni
Expand Down
3 changes: 3 additions & 0 deletions pkg/workloads/cluster-density.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func NewClusterDensity(wh *WorkloadHelper, variant string) *cobra.Command {
var iterations, churnPercent int
var churn bool
var churnDelay, churnDuration time.Duration
var podReadyThreshold time.Duration
cmd := &cobra.Command{
Use: variant,
Short: fmt.Sprintf("Runs %v workload", variant),
Expand All @@ -41,11 +42,13 @@ func NewClusterDensity(wh *WorkloadHelper, variant string) *cobra.Command {
os.Setenv("CHURN_DURATION", fmt.Sprintf("%v", churnDuration))
os.Setenv("CHURN_DELAY", fmt.Sprintf("%v", churnDelay))
os.Setenv("CHURN_PERCENT", fmt.Sprint(churnPercent))
os.Setenv("POD_READY_THRESHOLD", fmt.Sprintf("%v", podReadyThreshold))
},
Run: func(cmd *cobra.Command, args []string) {
wh.run(cmd.Name(), MetricsProfileMap[cmd.Name()])
},
}
cmd.Flags().DurationVar(&podReadyThreshold, "pod-ready-threshold", 2*time.Minute, "Pod ready timeout threshold")
cmd.Flags().IntVar(&iterations, "iterations", 0, fmt.Sprintf("%v iterations", variant))
cmd.Flags().BoolVar(&churn, "churn", true, "Enable churning")
cmd.Flags().DurationVar(&churnDuration, "churn-duration", 1*time.Hour, "Churn duration")
Expand Down
2 changes: 1 addition & 1 deletion pkg/workloads/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func NewIndex(metricsEndpoint *string, metadata *BenchmarkMetadata, ocpMetaAgent
}
},
}
cmd.Flags().StringVar(&metricsProfile, "metrics-profile", "metrics.yml", "Metrics profile file")
cmd.Flags().StringVarP(&metricsProfile, "metrics-profile", "m", "metrics.yml", "Metrics profile file")
cmd.Flags().StringVar(&metricsDirectory, "metrics-directory", "collected-metrics", "Directory to dump the metrics files in, when using default local indexing")
cmd.Flags().DurationVar(&prometheusStep, "step", 30*time.Second, "Prometheus step size")
cmd.Flags().Int64Var(&start, "start", time.Now().Unix()-3600, "Epoch start time")
Expand Down
4 changes: 4 additions & 0 deletions pkg/workloads/node-density-cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package workloads
import (
"fmt"
"os"
"time"

log "github.com/sirupsen/logrus"

Expand All @@ -27,6 +28,7 @@ import (
func NewNodeDensityCNI(wh *WorkloadHelper) *cobra.Command {
var podsPerNode int
var namespacedIterations bool
var podReadyThreshold time.Duration
var iterationsPerNamespace int
cmd := &cobra.Command{
Use: "node-density-cni",
Expand All @@ -42,11 +44,13 @@ func NewNodeDensityCNI(wh *WorkloadHelper) *cobra.Command {
os.Setenv("JOB_ITERATIONS", fmt.Sprint((totalPods-podCount)/2))
os.Setenv("NAMESPACED_ITERATIONS", fmt.Sprint(namespacedIterations))
os.Setenv("ITERATIONS_PER_NAMESPACE", fmt.Sprint(iterationsPerNamespace))
os.Setenv("POD_READY_THRESHOLD", fmt.Sprintf("%v", podReadyThreshold))
},
Run: func(cmd *cobra.Command, args []string) {
wh.run(cmd.Name(), MetricsProfileMap[cmd.Name()])
},
}
cmd.Flags().DurationVar(&podReadyThreshold, "pod-ready-threshold", 1*time.Minute, "Pod ready timeout threshold")
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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/workloads/node-density-heavy.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewNodeDensityHeavy(wh *WorkloadHelper) *cobra.Command {
wh.run(cmd.Name(), MetricsProfileMap[cmd.Name()])
},
}
cmd.Flags().DurationVar(&podReadyThreshold, "pod-ready-threshold", 1*time.Hour, "Pod ready timeout threshold")
cmd.Flags().DurationVar(&podReadyThreshold, "pod-ready-threshold", 2*time.Minute, "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")
Expand Down

0 comments on commit b1350f8

Please sign in to comment.