finch

package module
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: 12 Imported by: 0

README

MySQL Benchmarking

Finch is a MySQL benchmarking tool. Read the docs to learn more.

Documentation

Index

Constants

View Source
const (
	VERSION = "1.0.0"

	DEFAULT_SERVER_PORT = "33075"

	COPY_NUMBER = `/*!copy-number*/`

	NOOP_COLUMN = "_"

	ROWS = 100000
)
View Source
const (
	SCOPE_GLOBAL       = "global"
	SCOPE_STAGE        = "stage"
	SCOPE_WORKLOAD     = "workload"
	SCOPE_EXEC_GROUP   = "exec-group"
	SCOPE_CLIENT_GROUP = "client-group"
	SCOPE_CLIENT       = "client"
	SCOPE_ITER         = "iter"
	SCOPE_TRX          = "trx"
	SCOPE_STATEMENT    = "statement"
	SCOPE_ROW          = "row" // special: INSERT INTO t VALUES (@d), (@d), ...
	SCOPE_VALUE        = "value"
)
View Source
const (
	Eabort     = 0         // default (set to clear default flags)
	Ereconnect = 1 << iota // reconnect, next iter
	Econtinue              // don't reconnect, continue next iter
	Esilent                // don't repot error or reconnect
	Erollback              // execute ROLLBACK if in trx
)

Variables

View Source
var (
	CPUProfile io.Writer // --cpu-profile FILE
	Debugging  = false
)
View Source
var MakeHTTPClient func() *http.Client = func() *http.Client {
	tr := &http.Transport{
		MaxIdleConns:    1,
		IdleConnTimeout: 1 * time.Hour,
	}
	return &http.Client{Transport: tr}
}
View Source
var ModifyDB func(*sql.DB, RunLevel)
View Source
var MySQLErrorHandling = map[uint16]byte{
	1046: Eabort,
	1062: Eabort,
	1064: Eabort,
	1146: Eabort,
	1205: Erollback | Econtinue,
	1213: Econtinue,
	1290: Erollback | Econtinue,
	1317: Econtinue,
	1836: Erollback | Econtinue,
}
View Source
var SystemParams = map[string]string{}

Functions

func Bool

func Bool(s string) bool

func BoolString

func BoolString(b bool) string

func Debug

func Debug(msg string, v ...interface{})

func RunLevelIsValid

func RunLevelIsValid(s string) bool

func RunLevelNumber

func RunLevelNumber(s string) uint

func Uint

func Uint(s string) uint

Uint returns s as a unit presuming s has already been validated.

func WithPort

func WithPort(s, p string) string

WithPort return s:p if s doesn't have port suffix p. p must not have a colon prefix.

Types

type RunLevel

type RunLevel struct {
	Stage         uint
	StageName     string
	ExecGroup     uint
	ExecGroupName string
	ClientGroup   uint
	Client        uint
	Trx           uint
	TrxName       string
	Query         uint64
}

func (RunLevel) ClientId

func (s RunLevel) ClientId() string

func (RunLevel) GreaterThan

func (rl RunLevel) GreaterThan(prev RunLevel, s string) bool

func (RunLevel) String

func (s RunLevel) String() string

Directories

Path Synopsis
bin
Package dbconn provides a Factory that makes *sql.DB connections to MySQL.
Package dbconn provides a Factory that makes *sql.DB connections to MySQL.

Jump to

Keyboard shortcuts

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