Skip to content

Commit

Permalink
Minor changes and documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <rsevilla@redhat.com>
  • Loading branch information
rsevilla87 committed May 10, 2023
1 parent 9d05c66 commit cf92187
Show file tree
Hide file tree
Showing 7 changed files with 1,930 additions and 37 deletions.
60 changes: 58 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,66 @@
# ingress-perf
# ingress-perf - OCP Ingress Performance

OCP Ingress performance ultimate tool!

![diagram](doc-assets/diagram.png)

## Reference

Ingress-perf configuration is defined in a YAML file, holding an array of the following structure. [Examples directory](./examples)

| Field Name | Type | Description | Default Value |
|------------------|------------------|----------------------------------------------------------------------------------------------------------|---------------|
| `Termination` | `string` | Defines the type of benchmark termination. Allowed values are `http`, `edge`, `reencrypt` and `reencrypt`. | N/A |
| `Connections` | `int` | Defines the number of connections per client. | `0` |
| `Samples` | `int` | Defines the number of samples per scenario. | `0` |
| `Duration` | `time.Duration` | Defines the duration of each sample. | `""` |
| `Path` | `string` | Defines the scenario endpoint path, for example: `/1024.html`, `/2048.html`. | `""` |
| `Concurrency` | `int32` | Defines the number of clients that will concurrently run the benchmark scenario. | `0` |
| `Tool` | `string` | Defines the tool to run the benchmark scenario. | `""` |
| `ServerReplicas` | `int32` | Defines the number of server (nginx) replicas backed by the routes. | `0` |
| `Tuning` | `string` | Defines a tuning patch for the default `IngressController` object. | `""` |
| `Delay` | `time.Duration` | Defines a delay between samples. | `0s` |
| `Warmup` | `bool` | Enables warmup: indexing will be disabled in this scenario. The default value is `false`. | `false` |

## Running

## Compile
Running ingress-perf is trivial:

```console
$ ./bin/ingress-perf -h
Benchmark OCP ingress stack

Usage:
[command]

Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
run Run benchmark

Flags:
-h, --help help for this command

Use " [command] --help" for more information about a command.
```

Use the `run` subcommand to trigger a new benchmark. For example:

```console
$ ./bin/ingress-perf run --cfg cfg.yaml --es-server=https://elasticsearch-instance.com
time="2023-05-10 13:24:37" level=info msg="Running ingress performance 7eba7c57-d875-4b99-a490-be1752b62782" file="ingress-perf.go:39"
time="2023-05-10 13:24:37" level=info msg="Creating elastic indexer" file="ingress-perf.go:44"
time="2023-05-10 13:24:39" level=info msg="Starting ingress-perf" file="runner.go:36"
time="2023-05-10 13:24:40" level=info msg="Deploying benchmark assets" file="runner.go:112"
time="2023-05-10 13:24:41" level=info msg="Running test 1/9: http" file="runner.go:62"
```

Check out the `run` subcommand help for more info about the allowed flags.

## Compile

Go 1.19 is required

```console
$ make build
```
16 changes: 0 additions & 16 deletions cmd/ingress-perf.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,8 @@ func run() *cobra.Command {
return cmd
}

func cleanup() *cobra.Command {
var timeout time.Duration
cmd := &cobra.Command{
Use: "cleanup",
Short: "Cleanup benchmark assets",
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
err := runner.Cleanup(timeout)
return err
},
}
cmd.Flags().DurationVarP(&timeout, "timeout", "t", time.Minute, "Cleanup timeout")
return cmd
}

func main() {
cmd.AddCommand(run())
cmd.AddCommand(cleanup())
if err := cmd.Execute(); err != nil {
log.Fatal(err.Error())
}
Expand Down
Loading

0 comments on commit cf92187

Please sign in to comment.