Documentation ¶
Index ¶
- func BuildStage(ctx context.Context, cli *mongo.Client, roc <-chan RawMongoOp, ...) (<-chan ExecFunc, <-chan error)
- func CollectStat(opInfoCh <-chan OpInfo) models.LoadStat
- func ExecStage(ctx context.Context, fc <-chan ExecFunc, workers, resSize int, ...) <-chan OpInfo
- func GenerateAmmo(r io.Reader, w io.Writer) error
- func NewMongoClient(ctx context.Context, uri string) (*mongo.Client, error)
- func PrintStat(stat models.LoadStat, writer io.Writer) error
- func RandSeq(n int) string
- func ReadRawStage(ctx context.Context, r io.Reader, size int, wg *sync.WaitGroup) (<-chan RawMongoOp, <-chan error, error)
- type AbortOp
- type CommandOp
- type ExecFunc
- func NewAbortExec(_ *mongo.Client, op *AbortOp) ExecFunc
- func NewExecFunc(client *mongo.Client, opdata RawMongoOp) (ExecFunc, error)
- func NewOpExec(client *mongo.Client, op *CommandOp) ExecFunc
- func NewSleepExec(client *mongo.Client, op *SleepOp) ExecFunc
- func NewTxnExec(client *mongo.Client, op *TxnOp) ExecFunc
- type OpInfo
- type RawMongoOp
- type SleepOp
- type TxnOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildStage ¶
func CollectStat ¶
Types ¶
type AbortOp ¶
type AbortOp struct {
ID int `json:"id"`
}
func NewAbortOp ¶
func NewAbortOp(cd RawMongoOp) (*AbortOp, error)
type CommandOp ¶
type CommandOp struct { DB string `json:"db"` ID int `json:"id"` // contains filtered or unexported fields }
func NewCommandOp ¶
func NewCommandOp(rawOp RawMongoOp) (*CommandOp, error)
type ExecFunc ¶
func NewExecFunc ¶
func NewExecFunc(client *mongo.Client, opdata RawMongoOp) (ExecFunc, error)
type RawMongoOp ¶
type RawMongoOp struct { OP string `json:"op,omitempty"` DB string `json:"db,omitempty"` ID int `json:"id,omitempty"` Cmd json.RawMessage `json:"dc,omitempty"` }
type SleepOp ¶
type SleepOp struct { DB string `json:"db"` Coll string `json:"cl"` ID int `json:"id"` Duration float32 `json:"time"` }
func NewSleepOp ¶
func NewSleepOp(rawOp RawMongoOp) (*SleepOp, error)
type TxnOp ¶
type TxnOp struct { Cmds []RawMongoOp `json:"dc"` ID int `json:"id"` // contains filtered or unexported fields }
func NewTxnOp ¶
func NewTxnOp(rawOp RawMongoOp) (*TxnOp, error)
Click to show internal directories.
Click to hide internal directories.