client

package
v0.13.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomMakerRegistry *customMakerRegistry = new(customMakerRegistry)

Use CustomMakerRegistry with --maker to use a specific entity for Response.Data.

Functions

func Parse added in v0.6.0

func Parse(p string, cp *CliPayload) error

Parse expects the following format: "<input name>:[<type>|]<CSV values>[;<input name>:...]". If type is not provided, then it will be string; otherwise, "int" and "float32" can be used.

func Run

func Run(args []string)

func RunWithOptions

func RunWithOptions(runOpts *Options) error

Types

type C added in v0.6.0

type C uint8
const (
	None C = iota
	Single
	Batch
)

type CliPayload added in v0.6.0

type CliPayload struct {
	Data  map[string]interface{}
	Batch int
}

func (*CliPayload) Bind added in v0.6.0

func (c *CliPayload) Bind(k string, value interface{}, msg *client.Message) error

Bind delegates types to appropriate client.Message method.

func (*CliPayload) Iterator added in v0.6.0

func (c *CliPayload) Iterator(pair common.Pair) error

func (*CliPayload) Pair added in v0.6.0

func (c *CliPayload) Pair(key string, value interface{}) error

func (*CliPayload) SetBatch added in v0.6.0

func (c *CliPayload) SetBatch(msg *client.Message)

type Options

type Options struct {
	Host    string `long:"host" description:"endpoint host"`
	Port    int    `short:"p" long:"port" description:"endpoint port"`
	Address string `long:"address" description:"address overrides host and port"`

	Debug     bool `long:"debug"`
	TimeoutUs int  `short:"t" long:"timeout"`

	Model       string `short:"m" long:"model" description:"model"`
	Storable    string `short:"s" long:"storable"`
	CustomMaker string `long:"maker" description:"non-storable Response.Data, requires binding with CustomMaker"`

	CacheMB     int  `long:"cache"`
	NoHashCheck bool `long:"nohash"`

	Workers    int `long:"workers"`
	Concurrent int `long:"concurrent"`
	// In the case Workers > 1, Repeats is the total number of times each payload
	// is run, not the number of times each workers sends the paylod.
	Repeats int `long:"repeats" description:"times to repeat all payloads"`

	PayloadStr   []string `short:"a" long:"payload"`
	PayloadPause int      `long:"pause" description:"pause seconds between payloads"`
	PayloadDelay int      `long:"delay" description:"pause seconds from first payload"`

	SkipError bool `long:"skiperrs"`

	NoOutput     bool `long:"noout"`
	Metrics      bool `long:"metrics"`
	ErrorHistory bool `long:"errhist"`

	// Report forces NoOutput and SkipError true, Metrics and ErrorHistory false.
	// Will generate a final JSON object as its only output to stdout.
	// stderr may have other output if Debug is true or there are other errors.
	Report bool `long:"report"`
}

func (*Options) Hosts

func (o *Options) Hosts() []*client.Host

func (*Options) Init

func (o *Options) Init()

func (*Options) Payloads added in v0.9.0

func (o *Options) Payloads() ([]*CliPayload, error)

func (*Options) Validate

func (o *Options) Validate() error

type RepeatSet added in v0.13.0

type RepeatSet struct {
	Num       int
	WPayloads []WorkerPayload
}

type Report added in v0.13.0

type Report struct {
	Start time.Time
	End   time.Time

	Runs    []RepeatSet
	Metrics []gmetric.Operation
}

type WPRun added in v0.13.0

type WPRun struct {
	Response *client.Response
	Err      error
}

type WorkerPayload added in v0.13.0

type WorkerPayload struct {
	Payload *CliPayload
	Worker  int

	Runs []WPRun
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL