Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial design/api for progressive ramp up #718

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions cli/fortio_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ var (
qpsFlag = flag.Float64("qps", defaults.QPS, "Queries Per Seconds or 0 for no wait/max qps")
numThreadsFlag = flag.Int("c", defaults.NumThreads, "Number of connections/goroutine/threads")
durationFlag = flag.Duration("t", defaults.Duration, "How long to run the test or 0 to run until ^C")
rampFlag = flag.Duration("ramp", 0, "Ramp/Warm up time from initial to target QPS")
percentilesFlag = flag.String("p", "50,75,90,99,99.9", "List of pXX to calculate")
resolutionFlag = flag.Float64("r", defaults.Resolution, "Resolution of the histogram lowest buckets in seconds")
offsetFlag = flag.Duration("offset", defaults.Offset, "Offset of the histogram data")
Expand Down Expand Up @@ -405,6 +406,7 @@ func fortioLoad(justCurl bool, percList []float64, hook bincommon.FortioHook) {
ro := periodic.RunnerOptions{
QPS: qps,
Duration: *durationFlag,
Ramp: *rampFlag,
NumThreads: *numThreadsFlag,
Percentiles: percList,
Resolution: *resolutionFlag,
Expand Down
13 changes: 12 additions & 1 deletion periodic/periodic.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ var DefaultRunnerOptions = RunnerOptions{
NumThreads: 4,
Percentiles: []float64{90.0},
Resolution: 0.001, // milliseconds
// Not used unless Ramp is non zero, but if it is:
InitialNumThreads: 1,
}

type ThreadID int
Expand Down Expand Up @@ -170,12 +172,21 @@ type RunnerOptions struct {
Runners []Runnable `json:"-"`
// At which (target) rate to run the Runners across NumThreads.
QPS float64
// Initial QPS. Used if Ramp duration is specified, will increase the target from InitialQPS to QPS over Ramp duration.
InitialQPS float64
// Ramp duration. If specified, will increase the target from InitialQPS to QPS over Ramp duration.
// default is no ramp up.
Ramp time.Duration
// How long to run the test for. Unless Exactly is specified.
Duration time.Duration
// Note that this actually maps to gorountines and not actual threads
// but threads seems like a more familiar name to use for non go users
// and in a benchmarking context
// and in a benchmarking context.
NumThreads int
// InitialNumThreads is the number of threads to start with when using Ramp.
// If Ramp is specified, will increase the number of threads from InitialNumThreads
// to NumThreads over Ramp duration.
InitialNumThreads int
// List of percentiles to calculate.
Percentiles []float64
// Divider to apply to duration data in seconds. Defaults to 0.001 or 1 millisecond.
Expand Down