Versions in this module Expand all Collapse all v0 v0.97.0 May 24, 2021 Changes in this version type Option + func WithExtraGrpcOptions(extraOpts ...grpc.DialOption) Option v0.96.0 May 24, 2021 Changes in this version + const ReasonCancel + const ReasonNormalEnd + const ReasonTimeout + const ScheduleConst + const ScheduleLine + const ScheduleStep + var ErrEndStream = errors.New("ending stream") + var ErrLastMessage = errors.New("last message") + func LoadConfig(p string, c *Config) error + type BinaryDataFunc func(mtd *desc.MethodDescriptor, callData *CallData) []byte + type Bucket struct + Count int + Frequency float64 + Mark float64 + type CallData struct + FullyQualifiedName string + InputName string + IsClientStreaming bool + IsServerStreaming bool + MethodName string + OutputName string + RequestNumber int64 + ServiceName string + Timestamp string + TimestampUnix int64 + TimestampUnixMilli int64 + TimestampUnixNano int64 + UUID string + WorkerID string + func (td *CallData) ExecuteData(data string) ([]byte, error) + func (td *CallData) Regenerate() *CallData + type Config struct + Async bool + Authority string + BinData []byte + BinDataPath string + C uint + CEnd uint + CMaxDuration Duration + CName string + CPUs uint + CSchedule string + CStart uint + CStep int + CStepDuration Duration + Call string + Cert string + Connections uint + CountErrors bool + Data interface{} + DataPath string + Debug string + DialTimeout Duration + EnableCompression bool + Format string + Host string + ImportPaths []string + Insecure bool + KeepaliveTime Duration + Key string + LBStrategy string + LoadEnd uint + LoadMaxDuration Duration + LoadSchedule string + LoadStart uint + LoadStep int + LoadStepDuration Duration + Metadata map[string]string + MetadataPath string + N uint + Name string + Output string + Proto string + Protoset string + RPS uint + ReflectMetadata map[string]string + RootCert string + SI Duration + SkipFirst uint + SkipTLSVerify bool + StreamCallCount uint + StreamCallDuration Duration + StreamDynamicMessages bool + Tags map[string]string + Timeout Duration + X Duration + Z Duration + ZStop string + type Counter struct + func (c *Counter) Get() uint64 + func (c *Counter) Inc() uint64 + type DataProviderFunc func(*CallData) ([]*dynamic.Message, error) + type Duration time.Duration + func (d *Duration) UnmarshalJSON(text []byte) error + func (d *Duration) UnmarshalText(text []byte) error + func (d Duration) MarshalJSON() ([]byte, error) + func (d Duration) MarshalText() ([]byte, error) + func (d Duration) String() string + type LatencyDistribution struct + Latency time.Duration + Percentage int + type Logger interface + Debug func(args ...interface{}) + Debugf func(template string, args ...interface{}) + Debugw func(msg string, keysAndValues ...interface{}) + Error func(args ...interface{}) + Errorf func(template string, args ...interface{}) + Errorw func(msg string, keysAndValues ...interface{}) + type MetadataProviderFunc func(*CallData) (*metadata.MD, error) + type Option func(*RunConfig) error + func WithAsync(async bool) Option + func WithAuthority(authority string) Option + func WithBinaryData(data []byte) Option + func WithBinaryDataFromFile(path string) Option + func WithBinaryDataFunc(data func(mtd *desc.MethodDescriptor, callData *CallData) []byte) Option + func WithCPUs(c uint) Option + func WithCertificate(cert, key string) Option + func WithClientLoadBalancing(strategy string) Option + func WithConcurrency(c uint) Option + func WithConcurrencyDuration(duration time.Duration) Option + func WithConcurrencyEnd(v uint) Option + func WithConcurrencySchedule(schedule string) Option + func WithConcurrencyStart(v uint) Option + func WithConcurrencyStep(step int) Option + func WithConcurrencyStepDuration(duration time.Duration) Option + func WithConfig(cfg *Config) Option + func WithConfigFromFile(file string) Option + func WithConfigFromReader(reader io.Reader) Option + func WithConnections(c uint) Option + func WithCountErrors(v bool) Option + func WithData(data interface{}) Option + func WithDataFromFile(path string) Option + func WithDataFromJSON(data string) Option + func WithDataFromReader(r io.Reader) Option + func WithDataProvider(fn DataProviderFunc) Option + func WithDialTimeout(dt time.Duration) Option + func WithDurationStopAction(action string) Option + func WithEnableCompression(enableCompression bool) Option + func WithInsecure(insec bool) Option + func WithKeepalive(k time.Duration) Option + func WithLoadDuration(duration time.Duration) Option + func WithLoadEnd(end uint) Option + func WithLoadSchedule(schedule string) Option + func WithLoadStart(start uint) Option + func WithLoadStep(step int) Option + func WithLoadStepDuration(duration time.Duration) Option + func WithLogger(log Logger) Option + func WithMetadata(md map[string]string) Option + func WithMetadataFromFile(path string) Option + func WithMetadataFromJSON(md string) Option + func WithMetadataProvider(fn MetadataProviderFunc) Option + func WithName(name string) Option + func WithPacer(p load.Pacer) Option + func WithProtoFile(proto string, importPaths []string) Option + func WithProtoset(protoset string) Option + func WithRPS(v uint) Option + func WithReflectionMetadata(md map[string]string) Option + func WithRootCertificate(cert string) Option + func WithRunDuration(z time.Duration) Option + func WithServerNameOverride(cname string) Option + func WithSkipFirst(c uint) Option + func WithSkipTLSVerify(skip bool) Option + func WithStreamCallCount(c uint) Option + func WithStreamCallDuration(d time.Duration) Option + func WithStreamDynamicMessages(v bool) Option + func WithStreamInterval(d time.Duration) Option + func WithStreamMessageProvider(fn StreamMessageProviderFunc) Option + func WithStreamRecvMsgIntercept(fn StreamRecvMsgInterceptFunc) Option + func WithTags(tags map[string]string) Option + func WithTemplateFuncs(funcMap template.FuncMap) Option + func WithTimeout(timeout time.Duration) Option + func WithTotalRequests(n uint) Option + func WithWorkerTicker(ticker load.WorkerTicker) Option + type Options struct + Async bool + Authority string + Binary bool + CACert string + CEnd uint + CMaxDuration time.Duration + CName string + CPUs int + CSchedule string + CStart uint + CStep int + CStepDuration time.Duration + Call string + Cert string + Concurrency uint + Connections uint + CountErrors bool + Data interface{} + DialTimeout time.Duration + Duration time.Duration + EnableCompression bool + Host string + ImportPaths []string + Insecure bool + KeepaliveTime time.Duration + Key string + LoadEnd uint + LoadMaxDuration time.Duration + LoadSchedule string + LoadStart uint + LoadStep int + LoadStepDuration time.Duration + Metadata *map[string]string + Name string + Proto string + Protoset string + RPS uint + SkipFirst uint + SkipTLS bool + Timeout time.Duration + Total uint + type Report struct + Average time.Duration + Count uint64 + Date time.Time + Details []ResultDetail + EndReason StopReason + ErrorDist map[string]int + Fastest time.Duration + Histogram []Bucket + LatencyDistribution []LatencyDistribution + Name string + Options Options + Rps float64 + Slowest time.Duration + StatusCodeDist map[string]int + Tags map[string]string + Total time.Duration + func Run(call, host string, options ...Option) (*Report, error) + func (r Report) MarshalJSON() ([]byte, error) + type Reporter struct + func (r *Reporter) Finalize(stopReason StopReason, total time.Duration) *Report + func (r *Reporter) Run() + type RequestCounter interface + Get func() uint64 + type Requester struct + func NewRequester(c *RunConfig) (*Requester, error) + func (b *Requester) Finish() *Report + func (b *Requester) Run() (*Report, error) + func (b *Requester) Stop(reason StopReason) + type ResultDetail struct + Error string + Latency time.Duration + Status string + Timestamp time.Time + type RunConfig struct + func NewConfig(call, host string, options ...Option) (*RunConfig, error) + type StopReason string + func ReasonFromString(str string) StopReason + func (s *StopReason) UnmarshalJSON(b []byte) error + func (s StopReason) MarshalJSON() ([]byte, error) + func (s StopReason) String() string + type StreamMessageProviderFunc func(*CallData) (*dynamic.Message, error) + type StreamRecvMsgInterceptFunc func(*dynamic.Message, error) error + type TickValue struct + type Worker struct + func (w *Worker) Stop()