Versions in this module Expand all Collapse all v0 v0.0.3 Sep 22, 2022 Changes in this version + const DefaultScenarioName + const GroupSeparator + const MaxRetriesGetPlannedVU + const MaxTimeToWaitForPlannedVU + 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 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 Max(a, b int64) int64 + func Min(a, b int64) int64 + func NormalizeAndAnonymizePath(path string) string + func RegisterExecutorConfigType(configType string, constructor ExecutorConfigConstructor) + func StrictJSONUnmarshal(data []byte, v interface{}) error + func WithExecutionState(ctx context.Context, s *ExecutionState) context.Context + func WithScenarioState(ctx context.Context, s *ScenarioState) 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 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<- metrics.SampleContainer) error + Run func(globalCtx, runCtx context.Context, samplesOut chan<- metrics.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 + Test *TestRunState + func GetExecutionState(ctx context.Context) *ExecutionState + func NewExecutionState(testRunState *TestRunState, et *ExecutionTuple, ...) *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) GetUniqueVUIdentifiers() (uint64, 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 ExecutionStatusInterrupted + 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<- metrics.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 + OrderedChecks []*Check + OrderedGroups []*Group + 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 HostAddress net.TCPAddr + func NewHostAddress(ip net.IP, portString string) (*HostAddress, error) + func (h *HostAddress) MarshalText() ([]byte, error) + func (h *HostAddress) String() string + func (h *HostAddress) UnmarshalText(text []byte) error + type IPNet struct + func ParseCIDR(s string) (*IPNet, error) + func (ipnet *IPNet) MarshalText() ([]byte, error) + 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() uint64 + 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 + BlockedHostnames types.NullHostnameTrie + ConsoleOutput null.String + DNS types.DNSConfig + DiscardResponseBodies null.Bool + Duration types.NullDuration + ExecutionSegment *ExecutionSegment + ExecutionSegmentSequence *ExecutionSegmentSequence + External map[string]json.RawMessage + HTTPDebug null.String + Hosts map[string]*HostAddress + InsecureSkipTLSVerify null.Bool + Iterations null.Int + LocalIPs types.NullIPPool + 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 map[string]string + Scenarios ScenarioConfigs + SetupTimeout types.NullDuration + Stages []Stage + SummaryTimeUnit null.String + SummaryTrendStats []string + SystemTags *metrics.SystemTagSet + TLSAuth []*TLSAuth + TLSCipherSuites *TLSCipherSuites + TLSVersion *TLSVersions + TeardownTimeout types.NullDuration + Thresholds map[string]metrics.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 RunStatusAbortedLimit + 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 + HandleSummary func(context.Context, *Summary) (map[string]io.Reader, error) + IsExecutable func(string) bool + MakeArchive func() *Archive + NewVU func(idLocal, idGlobal uint64, out chan<- metrics.SampleContainer) (InitializedVU, error) + SetOptions func(opts Options) error + SetSetupData func([]byte) + Setup func(ctx context.Context, out chan<- metrics.SampleContainer) error + Teardown func(ctx context.Context, out chan<- metrics.SampleContainer) error + type RuntimeOptions struct + CompatibilityMode null.String + Env map[string]string + IncludeSystemEnvVars null.Bool + KeyWriter null.String + NoSummary null.Bool + NoThresholds null.Bool + SummaryExport null.String + TestType null.String + 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 ScenarioState struct + Executor string + Name string + ProgressFn func() (float64, []string) + StartTime time.Time + func GetScenarioState(ctx context.Context) *ScenarioState + type SegmentedIndex struct + func NewSegmentedIndex(et *ExecutionTuple) *SegmentedIndex + func (s *SegmentedIndex) GoTo(value int64) (int64, int64) + func (s *SegmentedIndex) Next() (int64, int64) + func (s *SegmentedIndex) Prev() (int64, int64) + 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 + BuiltinMetrics *metrics.BuiltinMetrics + CookieJar *cookiejar.Jar + Dialer DialContexter + GetScenarioGlobalVUIter func() uint64 + GetScenarioLocalVUIter func() uint64 + GetScenarioVUIter func() uint64 + Group *Group + Iteration int64 + Logger *logrus.Logger + Options Options + RPSLimit *rate.Limiter + Samples chan<- metrics.SampleContainer + TLSConfig *tls.Config + Tags *TagMap + Transport http.RoundTripper + VUID uint64 + VUIDGlobal uint64 + func (s *State) CloneTags() map[string]string + type Summary struct + Metrics map[string]*metrics.Metric + NoColor bool + RootGroup *Group + TestRunDuration time.Duration + UIState UIState + 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 + Password null.String + type TLSCipherSuites []uint16 + func (s *TLSCipherSuites) MarshalJSON() ([]byte, error) + 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 TagMap struct + func NewTagMap(m map[string]string) *TagMap + func (tg *TagMap) Clone() map[string]string + func (tg *TagMap) Delete(k string) + func (tg *TagMap) Get(k string) (string, bool) + func (tg *TagMap) Len() int + func (tg *TagMap) Set(k, v string) + type TestPreInitState struct + BuiltinMetrics *metrics.BuiltinMetrics + KeyLogger io.Writer + Logger *logrus.Logger + Registry *metrics.Registry + RuntimeOptions RuntimeOptions + type TestRunState struct + Options Options + Runner Runner + type UIState struct + IsStdErrTTY bool + IsStdOutTTY bool + type VUActivationParams struct + DeactivateCallback func(InitializedVU) + Env map[string]string + Exec string + GetNextIterationCounters func() (uint64, uint64) + RunContext context.Context + Scenario string + Tags map[string]string