Skip to content

Commit

Permalink
Divide by 2 the number of iterations in node-density-cni (kube-burner…
Browse files Browse the repository at this point in the history
…#216)

* Divide by 2 the number of iterations

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

* Exit from indexMetadata if not elasticSearch server is set

Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 authored Nov 29, 2022
1 parent 402f4e7 commit 988a7ae
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
5 changes: 0 additions & 5 deletions cmd/kube-burner/ocp.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ func openShiftCmd() *cobra.Command {
}
wh.SetKubeBurnerFlags()
}
ocpCmd.PersistentPostRun = func(cmd *cobra.Command, args []string) {
if *esServer != "" {
wh.IndexMetadata()
}
}
ocpCmd.AddCommand(
workloads.NewClusterDensity(&wh),
workloads.NewNodeDensity(&wh),
Expand Down
4 changes: 3 additions & 1 deletion docs/ocp.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ This wrapper provides the following benefits among others:
- Prevents modifying configuration files to tweak some of the parameters of the workloads
- Discovers the Prometheus URL and authentication token, so the user does not have to perform those operations before using them.

It's also possible to customize the configuration before running the workload by extracting and them running it:
## Customizing workloads

It's possible to customize the workload configuration before running the workload by extracting, updating and finally running it:

```console
$ kube-burner ocp node-density --extract
Expand Down
5 changes: 3 additions & 2 deletions pkg/workloads/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ func (wh *WorkloadHelper) GatherMetadata() error {
return nil
}

func (wh *WorkloadHelper) IndexMetadata() {
func (wh *WorkloadHelper) indexMetadata() {
wh.Metadata.EndDate = time.Now().UTC()
if wh.envVars["ES_SERVER"] == "" {
log.Info("No metadata will be indexed")
return
}
esEndpoint := fmt.Sprintf("%v/%v/_doc", wh.envVars["ES_SERVER"], wh.envVars["ES_INDEX"])
body, _ := json.Marshal(wh.Metadata)
Expand Down Expand Up @@ -174,7 +175,7 @@ func (wh *WorkloadHelper) run(workload string) {
log.Fatal(err)
}
wh.Metadata.Passed = rc == 0
wh.IndexMetadata()
wh.indexMetadata()
os.Exit(rc)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/workloads/node-density-cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewNodeDensityCNI(wh *WorkloadHelper) *cobra.Command {
if err != nil {
log.Fatal(err)
}
os.Setenv("JOB_ITERATIONS", fmt.Sprint(totalPods-podCount))
os.Setenv("JOB_ITERATIONS", fmt.Sprint((totalPods-podCount)/2))
},
Run: func(cmd *cobra.Command, args []string) {
wh.run(cmd.Name())
Expand Down

0 comments on commit 988a7ae

Please sign in to comment.