client

package
v0.0.0-...-6530c03 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConnectTimeout   = 500 * time.Millisecond
	ConnectRetryWait = 200 * time.Millisecond
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// Required args
	DB         *sql.DB `deep:"-"`
	Data       []StatementData
	DoneChan   chan *Client
	RunLevel   finch.RunLevel
	Statements []*trx.Statement
	Stats      []*stats.Trx `deep:"-"`

	// Optional, usually from stage config
	DefaultDb        string
	IterExecGroup    uint32
	IterExecGroupPtr *uint32
	IterClients      uint32
	IterClientsPtr   *uint32
	Iter             uint
	QPS              <-chan bool
	TPS              <-chan bool

	// Retrun value to DoneChane
	Error Error
	// contains filtered or unexported fields
}

Client executes SQL statements. Each client is created in workload.Allocator.Clients and run in Stage.Run. Client.Init must be called once before calling Client.Run once.

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, cerr error, stmtNo int, trxActive bool) error

func (*Client) Init

func (c *Client) Init() error

func (*Client) Run

func (c *Client) Run(ctxExec context.Context)

type Error

type Error struct {
	Err         error
	StatementNo int
}

type StatementData

type StatementData struct {
	Inputs      []data.ValueFunc `deep:"-"` // input to query
	Outputs     []interface{}    `deep:"-"` // output from query; values are data.Generator
	InsertId    data.Generator   `deep:"-"`
	TrxBoundary byte
}

Jump to

Keyboard shortcuts

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