Documentation ¶
Index ¶
- func FlattenMultiError(mErr *multierror.Error) error
- func IsContextTriggered(ctx context.Context) bool
- func RecoverWithError(panicErr *error)
- func TrueCause(err error) error
- func WaitFor(ctx context.Context, duration time.Duration)
- type Buffer
- type DistributionSettings
- func (settings DistributionSettings) GetActionInfo() string
- func (settings DistributionSettings) GetMax() (float64, error)
- func (settings DistributionSettings) GetMin() (float64, error)
- func (settings DistributionSettings) RandDuration(rnd Randomizer) (time.Duration, error)
- func (settings DistributionSettings) Validate() error
- type DistributionType
- type Params
- type Randomizer
- type RowFile
- type TimeDuration
- type TreatAs
- type UniqueInts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenMultiError ¶
func FlattenMultiError(mErr *multierror.Error) error
FlattenMultiError return nil or original error if multierror does not have more than one error
func IsContextTriggered ¶
IsContextTriggered check if context is "done"
func RecoverWithError ¶
func RecoverWithError(panicErr *error)
RecoverWithError recovers from panic and sets error to panicErr
Types ¶
type Buffer ¶
func (*Buffer) String ¶
String returns the contents of the unread portion of the buffer as a string. If the Buffer is a nil pointer, it returns "<nil>".
func (*Buffer) WriteByte ¶
WriteByte appends the byte c to the buffer, growing the buffer as needed.
func (*Buffer) WriteBytes ¶
Write bytes to buffer, errors written to stderr
func (*Buffer) WriteRune ¶
WriteRune appends the UTF-8 encoding of Unicode code point r to the buffer, errors written to stderr
func (*Buffer) WriteString ¶
WriteString to buffer, errors written to stderr
type DistributionSettings ¶
type DistributionSettings struct { // Type of timer delay Type DistributionType `json:"type" displayname:"Distribution type" doc-key:"thinktime.type"` // Delay static delay when using static timer delay Delay float64 `json:"delay,omitempty" displayname:"Static delay" doc-key:"thinktime.delay"` // Mean value Mean float64 `json:"mean,omitempty" displayname:"Mean value" doc-key:"thinktime.mean"` // Deviation value Deviation float64 `json:"dev,omitempty" displayname:"Deviation value" doc-key:"thinktime.dev"` }
DistributionSettings think time settings
func (DistributionSettings) GetActionInfo ¶
func (settings DistributionSettings) GetActionInfo() string
GetActionInfo get information for action details logging
func (DistributionSettings) GetMax ¶
func (settings DistributionSettings) GetMax() (float64, error)
GetMax value
func (DistributionSettings) GetMin ¶
func (settings DistributionSettings) GetMin() (float64, error)
GetMin value
func (DistributionSettings) RandDuration ¶ added in v0.4.11
func (settings DistributionSettings) RandDuration(rnd Randomizer) (time.Duration, error)
RandDuration returns a random duration
func (DistributionSettings) Validate ¶
func (settings DistributionSettings) Validate() error
Validate DistributionSettings
type DistributionType ¶
type DistributionType int
DistributionType type of distribution
const ( // StaticDistribution fixed distribution StaticDistribution DistributionType = iota // UniformDistribution uniform distribution, defined by "mean" and "dev" UniformDistribution )
func (DistributionType) GetEnumMap ¶
func (value DistributionType) GetEnumMap() *enummap.EnumMap
GetEnumMap of DistributionType
func (DistributionType) MarshalJSON ¶
func (value DistributionType) MarshalJSON() ([]byte, error)
MarshalJSON marshal ThinkTime type
func (*DistributionType) UnmarshalJSON ¶
func (value *DistributionType) UnmarshalJSON(arg []byte) error
UnmarshalJSON unmarshal DistributionType
type Randomizer ¶ added in v0.4.11
type RowFile ¶
type RowFile struct {
// contains filtered or unexported fields
}
RowFile path to file on disc to read into memory
func NewRowFile ¶
NewRowFile reads rows from file path into memory
func (RowFile) MarshalJSON ¶
MarshalJSON marshal filepath to JSON
func (*RowFile) Rows ¶
Rows in memory from file, to read into memory, either ReadRows or UnmarshalJSON needs to have been called
func (*RowFile) UnmarshalJSON ¶
UnmarshalJSON reads file from filepath into memory
type TimeDuration ¶
func (TimeDuration) MarshalJSON ¶
func (duration TimeDuration) MarshalJSON() ([]byte, error)
MarshalJSON marshal time buffer duration to JSON
func (*TimeDuration) UnmarshalJSON ¶
func (duration *TimeDuration) UnmarshalJSON(arg []byte) error
UnmarshalJSON unmarshal time buffer duration from JSON
type TreatAs ¶
type TreatAs interface { /* Supported types: String Int Float Enum Bool Slice SliceElement StringMap StringMapElement */ TreatAs() string }
Implement this interface to override the type a struct is treated as by the GUI
type UniqueInts ¶ added in v0.5.3
type UniqueInts map[int]struct{}
func (*UniqueInts) AddValue ¶ added in v0.5.3
func (u *UniqueInts) AddValue(v int)
AddValue to unique list
func (*UniqueInts) Array ¶ added in v0.5.3
func (u *UniqueInts) Array() []int
Array of unique integers
func (*UniqueInts) HasValue ¶ added in v0.5.3
func (u *UniqueInts) HasValue(v int) bool
HasValue test if collection includes value