Skip to content

Commit

Permalink
update(cmd): update bench command description
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
  • Loading branch information
leogr authored and poiana committed Nov 7, 2020
1 parent 2795e74 commit 71befd2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions cmd/bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/spf13/cobra"
)

var roundDurationMustBeLongerThanSleepErr = errors.New("--round-duration must be longer than --sleep")
var errRoundDurationMustBeLongerThanSleep = errors.New("--round-duration must be longer than --sleep")

// NewBench instantiates the bench subcommand.
func NewBench() *cobra.Command {
Expand All @@ -25,15 +25,18 @@ This command generates a high number of Event Per Second (EPS), to test the even
The number of EPS is controlled by the "--sleep" option: reduce the sleeping duration to increase the EPS.
If the "--loop" option is set, the sleeping duration is halved on each round.
The "--pid" option can be used to monitor the Falco process.
The easiest way to get the PID is by appending the following snippet:
--pid $(ps -ef | awk '$8=="falco" {print $2}')
N.B.:
- the Falco gRPC Output must be enabled to use this command
- also, you may need to increase the "outputs.rate" and "outputs.max_burst" values within the Falco configuration,
otherwise EPS will be rate-limited by the throttling mechanism.
Since not all actions can be used for benchmarking, only those actions matching the given regular expression are used.
- "outputs.rate" and "outputs.max_burst" values within the Falco configuration must be increased,
otherwise EPS will be rate-limited by the throttling mechanism
- since not all actions can be used for benchmarking,
only those actions matching the given regular expression are used
One commmon way to use this command is as following:
event-generator bench "ChangeThreadNamespace|ReadSensitiveFileUntrusted" --loop --sleep 10ms --pid $(pidof -s falco)
` + runWarningMessage

Expand Down Expand Up @@ -70,7 +73,7 @@ Since not all actions can be used for benchmarking, only those actions matching
}

if roundDuration <= sleep {
return roundDurationMustBeLongerThanSleepErr
return errRoundDurationMustBeLongerThanSleep
}

opts := append([]counter.Option(nil),
Expand Down

0 comments on commit 71befd2

Please sign in to comment.