Skip to content

Commit c21060e

Browse files
committed
supported percentile option
1 parent 32bb37d commit c21060e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

runner/runner.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ const (
1717
histogramSize = 1024
1818
histogramMin = 0.001
1919
histogramMax = 100000
20-
21-
percentile = 95
2220
)
2321

2422
type (
@@ -28,6 +26,7 @@ type (
2826
Time int `long:"time" description:"limit for total execution time in seconds" default:"10"`
2927
ReportInterval int `long:"report-interval" description:"periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports" default:"0"`
3028
Histogram string `long:"histogram" choice:"on" choice:"off" description:"print latency histogram in report" default:"off"` //nolint:staticcheck
29+
Percentile int `long:"percentile" description:"percentile to calculate in latency statistics (1-100)" default:"95"`
3130
}
3231

3332
Runner struct {
@@ -83,6 +82,8 @@ func (r *Runner) Run(bench benchmark.Benchmark) error {
8382
fmt.Printf("Report intermediate results every %d second(s)\n\n\n", r.opts.ReportInterval)
8483
}
8584

85+
var percentile = r.opts.Percentile
86+
8687
err := bench.Init(context.Background())
8788
if err != nil {
8889
return err

0 commit comments

Comments
 (0)