Document GeneratorOptions in loadgenerator.
@@ -41,13 +41,21 @@ const (
// GeneratorOptions provides knobs to run the perf test
type GeneratorOptions struct {
+ // Duration is the total time to generate the load.
Duration time.Duration
+ // NumThreads is the number of threads generating the load.
NumThreads int
+ // NumConnections controls the number of idle connections Transport keeps.
NumConnections int
+ // URL is the endpoint of the target service.
URL string
+ // Domain is the domain name of the target service.
Domain string
+ // RequestTimeout is the maximum time waiting for a response.
RequestTimeout time.Duration
+ // QPS is the total QPS generated by all threads.
QPS float64
+ // AllowInitialErrors specifies whether initial errors will abort the load.
AllowInitialErrors bool
}
@@ -58,11 +66,11 @@ type GeneratorResults struct {
// addDefaults adds default values to non mandatory params
func (g *GeneratorOptions) addDefaults() {
- if (g.RequestTimeout == 0) {
+ if g.RequestTimeout == 0 {
g.RequestTimeout = duration
}
- if (g.QPS == 0) {
+ if g.QPS == 0 {
g.QPS = qps
}
}
