Documentation
¶
Index ¶
- type Dispatcher
- type Emul
- func (em *Emul) GetHisto() (histo metrics.Histogram, err error)
- func (em *Emul) MultiSend(ctx context.Context, in <-chan interface{}, args *SendArgs, ...) (err error)
- func (em *Emul) SendReq(ctx context.Context, filePath string, args *SendArgs) (err error)
- func (em *Emul) SetLogger(logger slog.Logger)
- type Request
- type Requester
- type SendArgs
- type SendType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher interface { SendReq(ctx context.Context, filePath string, args *SendArgs) (err error) MultiSend(ctx context.Context, req <-chan interface{}, args *SendArgs, wgSend *sync.WaitGroup) (err error) GetHisto() (histo metrics.Histogram, err error) }
Dispatcher sends requests to the endpoint.
type Emul ¶
type Emul struct { Dispatcher Dispatcher Client net.Client Filer sio.Filer Consoler cui.Consoler Logger slog.Logger Limiter throt.Limiter Histogram metrics.Histogram }
Emul - Emulatator interface implementation.
func NewEmul ¶
func NewEmul(clt net.Client, flr sio.Filer, con cui.Consoler, limiter throt.Limiter, logger slog.Logger, histo metrics.Histogram) (em *Emul, err error)
NewEmul creates new emul instance.
func (*Emul) MultiSend ¶
func (em *Emul) MultiSend(ctx context.Context, in <-chan interface{}, args *SendArgs, wgSend *sync.WaitGroup) (err error)
MultiSend dispatches requests, controlling the number of concurrent connections.
type SendArgs ¶
type SendArgs struct { Data string SrcDir string Wildcard string SaveReqDir string SaveReqFilepath string SaveResDir string SaveResFilepath string Repeat uint CxnNum uint SleepMs uint Address string Port uint RateSec uint RateMin uint SendType SendType TmoSec uint TmoRdS uint TmoWrS uint TmoCxn uint CxnLim bool CltType conf.ClientType SaveReq bool SaveRes bool ReqID uint64 }
SendArgs send command arguments.
Click to show internal directories.
Click to hide internal directories.