Versions in this module Expand all Collapse all v0 v0.27.1 Jul 30, 2020 Changes in this version + const DefaultScenarioName + const GroupSeparator + const MaxRetriesGetPlannedVU + const MaxTimeToWaitForPlannedVU + const TLS13_CIPHER_SUITE_TLS_AES_128_GCM_SHA256 + const TLS13_CIPHER_SUITE_TLS_AES_256_GCM_SHA384 + const TLS13_CIPHER_SUITE_TLS_CHACHA20_POLY1305_SHA256 + const TLSVersion13 + var DefaultSummaryTrendStats = []string + var ErrNameContainsGroupSeparator = errors.New("group and check names may not contain '::'") + var SupportedTLSCipherSuites = map[string]uint16 + var SupportedTLSCipherSuitesToString = map[uint16]string + var SupportedTLSVersions = map[string]TLSVersion + var SupportedTLSVersionsToString = map[TLSVersion]string + func Clampf(val, min, max float64) float64 + func ConcatErrors(errors []error, separator string) string + func GetEndOffset(steps []ExecutionStep) (lastStepOffset time.Duration, isFinal bool) + func GetMaxPlannedVUs(steps []ExecutionStep) (result uint64) + func GetMaxPossibleVUs(steps []ExecutionStep) (result uint64) + func Lerp(x, y int64, t float64) int64 + func Max(a, b int64) int64 + func Min(a, b int64) int64 + func NormalizeAndAnonymizePath(path string) string + func RegisterExecutorConfigType(configType string, constructor ExecutorConfigConstructor) + func SplitKV(s string) (key, value string) + func StrictJSONUnmarshal(data []byte, v interface{}) error + func WithState(ctx context.Context, state *State) context.Context + type ActiveVU interface + RunOnce func() error + type Archive struct + CompatibilityMode string + Data []byte + Env map[string]string + Filename string + FilenameURL *url.URL + Filesystems map[string]afero.Fs + Goos string + K6Version string + Options Options + Pwd string + PwdURL *url.URL + Type string + func ReadArchive(in io.Reader) (*Archive, error) + func (arc *Archive) Write(out io.Writer) error + type Check struct + Fails int64 + Group *Group + ID string + Name string + Passes int64 + Path string + func NewCheck(name string, group *Group) (*Check, error) + type Collector interface + Collect func(samples []stats.SampleContainer) + GetRequiredSystemTags func() stats.SystemTagSet + Init func() error + Link func() string + Run func(ctx context.Context) + SetRunStatus func(status RunStatus) + type CompatibilityMode uint8 + const CompatibilityModeBase + const CompatibilityModeExtended + func CompatibilityModeString(s string) (CompatibilityMode, error) + func CompatibilityModeValues() []CompatibilityMode + func ValidateCompatibilityMode(val string) (cm CompatibilityMode, err error) + func (i CompatibilityMode) IsACompatibilityMode() bool + func (i CompatibilityMode) String() string + type DialContexter interface + DialContext func(ctx context.Context, network, addr string) (net.Conn, error) + type ExecutionScheduler interface + GetExecutors func() []Executor + GetRunner func() Runner + GetState func() *ExecutionState + Init func(ctx context.Context, samplesOut chan<- stats.SampleContainer) error + Run func(globalCtx, runCtx context.Context, samplesOut chan<- stats.SampleContainer) error + SetPaused func(paused bool) error + type ExecutionSegment struct + func NewExecutionSegment(from, to *big.Rat) (*ExecutionSegment, error) + func NewExecutionSegmentFromString(toStr string) (result *ExecutionSegment, err error) + func (es *ExecutionSegment) CopyScaleRat(value *big.Rat) *big.Rat + func (es *ExecutionSegment) Equal(other *ExecutionSegment) bool + func (es *ExecutionSegment) FloatLength() float64 + func (es *ExecutionSegment) InPlaceScaleRat(value *big.Rat) *big.Rat + func (es *ExecutionSegment) MarshalText() ([]byte, error) + func (es *ExecutionSegment) Scale(value int64) int64 + func (es *ExecutionSegment) Split(numParts int64) ([]*ExecutionSegment, error) + func (es *ExecutionSegment) String() string + func (es *ExecutionSegment) SubSegment(child *ExecutionSegment) *ExecutionSegment + func (es *ExecutionSegment) UnmarshalText(text []byte) (err error) + type ExecutionSegmentSequence []*ExecutionSegment + func GetFilledExecutionSegmentSequence(sequence *ExecutionSegmentSequence, fallback *ExecutionSegment) (result ExecutionSegmentSequence) + func NewExecutionSegmentSequence(segments ...*ExecutionSegment) (ExecutionSegmentSequence, error) + func NewExecutionSegmentSequenceFromString(strSeq string) (ExecutionSegmentSequence, error) + func (ess *ExecutionSegmentSequence) UnmarshalText(text []byte) (err error) + func (ess ExecutionSegmentSequence) FindSegmentPosition(segment *ExecutionSegment) (int, error) + func (ess ExecutionSegmentSequence) IsFull() bool + func (ess ExecutionSegmentSequence) LCD() int64 + func (ess ExecutionSegmentSequence) MarshalText() ([]byte, error) + func (ess ExecutionSegmentSequence) String() string + type ExecutionSegmentSequenceWrapper struct + func NewExecutionSegmentSequenceWrapper(ess ExecutionSegmentSequence) *ExecutionSegmentSequenceWrapper + func (essw *ExecutionSegmentSequenceWrapper) GetNewExecutionSegmentSequenceFromValue(value int64, trackedIndex int) (newSequence *ExecutionSegmentSequenceWrapper, newIndex int, err error) + func (essw *ExecutionSegmentSequenceWrapper) GetStripedOffsets(segmentIndex int) (int64, []int64, int64) + func (essw *ExecutionSegmentSequenceWrapper) GetTuple(segmentIndex int) *ExecutionTuple + func (essw *ExecutionSegmentSequenceWrapper) LCD() int64 + func (essw *ExecutionSegmentSequenceWrapper) ScaleInt64(segmentIndex int, value int64) int64 + type ExecutionState struct + ExecutionTuple *ExecutionTuple + Options Options + func NewExecutionState(options Options, et *ExecutionTuple, maxPlannedVUs, maxPossibleVUs uint64) *ExecutionState + func (es *ExecutionState) AddFullIterations(count uint64) uint64 + func (es *ExecutionState) AddInitializedVU(vu InitializedVU) + func (es *ExecutionState) AddInterruptedIterations(count uint64) uint64 + func (es *ExecutionState) GetCurrentExecutionStatus() ExecutionStatus + func (es *ExecutionState) GetCurrentTestRunDuration() time.Duration + func (es *ExecutionState) GetCurrentlyActiveVUsCount() int64 + func (es *ExecutionState) GetFullIterationCount() uint64 + func (es *ExecutionState) GetInitializedVUsCount() int64 + func (es *ExecutionState) GetPartialIterationCount() uint64 + func (es *ExecutionState) GetPlannedVU(logger *logrus.Entry, modifyActiveVUCount bool) (InitializedVU, error) + func (es *ExecutionState) GetUniqueVUIdentifier() uint64 + func (es *ExecutionState) GetUnplannedVU(ctx context.Context, logger *logrus.Entry) (InitializedVU, error) + func (es *ExecutionState) HasEnded() bool + func (es *ExecutionState) HasStarted() bool + func (es *ExecutionState) InitializeNewVU(ctx context.Context, logger *logrus.Entry) (InitializedVU, error) + func (es *ExecutionState) IsPaused() bool + func (es *ExecutionState) MarkEnded() + func (es *ExecutionState) MarkStarted() + func (es *ExecutionState) ModCurrentlyActiveVUsCount(mod int64) int64 + func (es *ExecutionState) ModInitializedVUsCount(mod int64) int64 + func (es *ExecutionState) Pause() error + func (es *ExecutionState) Resume() error + func (es *ExecutionState) ResumeNotify() <-chan struct{} + func (es *ExecutionState) ReturnVU(vu InitializedVU, wasActive bool) + func (es *ExecutionState) SetExecutionStatus(newStatus ExecutionStatus) (oldStatus ExecutionStatus) + func (es *ExecutionState) SetInitVUFunc(initVUFunc InitVUFunc) + type ExecutionStatus uint32 + const ExecutionStatusCreated + const ExecutionStatusEnded + const ExecutionStatusInitDone + const ExecutionStatusInitExecutors + const ExecutionStatusInitVUs + const ExecutionStatusPausedBeforeRun + const ExecutionStatusRunning + const ExecutionStatusSetup + const ExecutionStatusStarted + const ExecutionStatusTeardown + func ExecutionStatusString(s string) (ExecutionStatus, error) + func ExecutionStatusValues() []ExecutionStatus + func (i ExecutionStatus) IsAExecutionStatus() bool + func (i ExecutionStatus) String() string + type ExecutionStep struct + MaxUnplannedVUs uint64 + PlannedVUs uint64 + TimeOffset time.Duration + type ExecutionTuple struct + Segment *ExecutionSegment + SegmentIndex int + Sequence *ExecutionSegmentSequenceWrapper + func NewExecutionTuple(segment *ExecutionSegment, sequence *ExecutionSegmentSequence) (*ExecutionTuple, error) + func (et *ExecutionTuple) GetNewExecutionTupleFromValue(value int64) (*ExecutionTuple, error) + func (et *ExecutionTuple) GetStripedOffsets() (int64, []int64, int64) + func (et *ExecutionTuple) ScaleInt64(value int64) int64 + func (et *ExecutionTuple) String() string + type Executor interface + GetConfig func() ExecutorConfig + GetLogger func() *logrus.Entry + GetProgress func() *pb.ProgressBar + Init func(ctx context.Context) error + Run func(ctx context.Context, engineOut chan<- stats.SampleContainer) error + type ExecutorConfig interface + GetDescription func(*ExecutionTuple) string + GetEnv func() map[string]string + GetExec func() string + GetExecutionRequirements func(*ExecutionTuple) []ExecutionStep + GetGracefulStop func() time.Duration + GetName func() string + GetStartTime func() time.Duration + GetTags func() map[string]string + GetType func() string + HasWork func(*ExecutionTuple) bool + IsDistributable func() bool + NewExecutor func(*ExecutionState, *logrus.Entry) (Executor, error) + Validate func() []error + func GetParsedExecutorConfig(name, configType string, rawJSON []byte) (result ExecutorConfig, err error) + type ExecutorConfigConstructor func(name string, rawJSON []byte) (ExecutorConfig, error) + type Group struct + Checks map[string]*Check + Groups map[string]*Group + ID string + Name string + Parent *Group + Path string + func NewGroup(name string, parent *Group) (*Group, error) + func (g *Group) Check(name string) (*Check, error) + func (g *Group) Group(name string) (*Group, error) + type IPNet net.IPNet + func ParseCIDR(s string) (*IPNet, error) + func (ipnet *IPNet) String() string + func (ipnet *IPNet) UnmarshalText(b []byte) error + type InitVUFunc func(context.Context, *logrus.Entry) (InitializedVU, error) + type InitializedVU interface + Activate func(*VUActivationParams) ActiveVU + GetID func() int64 + type LiveUpdatableExecutor interface + UpdateConfig func(ctx context.Context, newConfig interface{}) error + type MultiSlotLimiter struct + func NewMultiSlotLimiter(slots int) *MultiSlotLimiter + func (l *MultiSlotLimiter) Slot(s string) SlotLimiter + type Options struct + Batch null.Int + BatchPerHost null.Int + BlacklistIPs []*IPNet + ConsoleOutput null.String + DiscardResponseBodies null.Bool + Duration types.NullDuration + ExecutionSegment *ExecutionSegment + ExecutionSegmentSequence *ExecutionSegmentSequence + External map[string]json.RawMessage + HTTPDebug null.String + Hosts map[string]net.IP + InsecureSkipTLSVerify null.Bool + Iterations null.Int + MaxRedirects null.Int + MetricSamplesBufferSize null.Int + MinIterationDuration types.NullDuration + NoConnectionReuse null.Bool + NoCookiesReset null.Bool + NoSetup null.Bool + NoTeardown null.Bool + NoVUConnectionReuse null.Bool + Paused null.Bool + RPS null.Int + RunTags *stats.SampleTags + Scenarios ScenarioConfigs + SetupTimeout types.NullDuration + Stages []Stage + SummaryTimeUnit null.String + SummaryTrendStats []string + SystemTags *stats.SystemTagSet + TLSAuth []*TLSAuth + TLSCipherSuites *TLSCipherSuites + TLSVersion *TLSVersions + TeardownTimeout types.NullDuration + Thresholds map[string]stats.Thresholds + Throw null.Bool + UserAgent null.String + VUs null.Int + func (o Options) Apply(opts Options) Options + func (o Options) ForEachSpecified(structTag string, callback func(key string, value interface{})) + func (o Options) Validate() []error + type PausableExecutor interface + SetPaused func(bool) error + type RunStatus int + const RunStatusAbortedScriptError + const RunStatusAbortedSystem + const RunStatusAbortedThreshold + const RunStatusAbortedUser + const RunStatusCreated + const RunStatusFinished + const RunStatusInitializing + const RunStatusQueued + const RunStatusRunning + const RunStatusTimedOut + const RunStatusValidated + type Runner interface + GetDefaultGroup func() *Group + GetOptions func() Options + GetSetupData func() []byte + IsExecutable func(string) bool + MakeArchive func() *Archive + NewVU func(id int64, out chan<- stats.SampleContainer) (InitializedVU, error) + SetOptions func(opts Options) error + SetSetupData func([]byte) + Setup func(ctx context.Context, out chan<- stats.SampleContainer) error + Teardown func(ctx context.Context, out chan<- stats.SampleContainer) error + type RuntimeOptions struct + CompatibilityMode null.String + Env map[string]string + IncludeSystemEnvVars null.Bool + type ScenarioConfigs map[string]ExecutorConfig + func (scs *ScenarioConfigs) UnmarshalJSON(data []byte) error + func (scs ScenarioConfigs) GetFullExecutionRequirements(et *ExecutionTuple) []ExecutionStep + func (scs ScenarioConfigs) GetSortedConfigs() []ExecutorConfig + func (scs ScenarioConfigs) Validate() (errors []error) + type SlotLimiter chan struct + func NewSlotLimiter(slots int) SlotLimiter + func (sl SlotLimiter) Begin() + func (sl SlotLimiter) End() + type Stage StageFields + func (s *Stage) UnmarshalJSON(b []byte) error + func (s *Stage) UnmarshalText(b []byte) error + func (s Stage) MarshalJSON() ([]byte, error) + type StageFields struct + Duration types.NullDuration + Target null.Int + type State struct + BPool *bpool.BufferPool + CookieJar *cookiejar.Jar + Dialer DialContexter + Group *Group + Iteration int64 + Logger *logrus.Logger + Options Options + RPSLimit *rate.Limiter + Samples chan<- stats.SampleContainer + TLSConfig *tls.Config + Tags map[string]string + Transport http.RoundTripper + Vu int64 + func GetState(ctx context.Context) *State + func (s *State) CloneTags() map[string]string + type TLSAuth struct + func (c *TLSAuth) Certificate() (*tls.Certificate, error) + func (c *TLSAuth) UnmarshalJSON(data []byte) error + type TLSAuthFields struct + Cert string + Domains []string + Key string + type TLSCipherSuites []uint16 + func (s *TLSCipherSuites) UnmarshalJSON(data []byte) error + type TLSVersion int + func (v *TLSVersion) UnmarshalJSON(data []byte) error + func (v TLSVersion) MarshalJSON() ([]byte, error) + type TLSVersions TLSVersionsFields + func (v *TLSVersions) UnmarshalJSON(data []byte) error + type TLSVersionsFields struct + Max TLSVersion + Min TLSVersion + type TimeoutError struct + func NewTimeoutError(place string, d time.Duration) TimeoutError + func (t TimeoutError) Error() string + func (t TimeoutError) Hint() string + func (t TimeoutError) Place() string + func (t TimeoutError) String() string + type VUActivationParams struct + DeactivateCallback func(InitializedVU) + Env map[string]string + Exec string + RunContext context.Context + Scenario string + Tags map[string]string