Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertByteSliceToFloatSlice(transactionDataString []byte) []float32
- func ConvertSliceStringToFloat(transactionDataString []string) []float32
- func Float32bytes(float float32) []byte
- func RandReferenceData(n int) []float32
- func Uint64frombytes(bytes []byte) uint64
- type BenchmarkRunner
- func (b *BenchmarkRunner) DatabaseName() string
- func (b *BenchmarkRunner) DebugLevel() int
- func (b *BenchmarkRunner) DoPrintResponses() bool
- func (b *BenchmarkRunner) GetBufferedReader() *bufio.Reader
- func (b *BenchmarkRunner) IgnoreErrors() bool
- func (b *BenchmarkRunner) Run(queryPool *sync.Pool, processorCreateFn ProcessorCreate, rowSizeBytes int)
- func (b *BenchmarkRunner) SetLimit(limit uint64)
- func (b *BenchmarkRunner) UseReferenceDataMysql() bool
- func (b *BenchmarkRunner) UseReferenceDataRedis() bool
- type LoadRunner
- type Loader
- type LoaderCreate
- type Processor
- type ProcessorCreate
- type RedisAI
- type Stat
Constants ¶
const (
Inf = rate.Limit(math.MaxFloat64)
)
Variables ¶
var FormatString1 = "%s,%d\n"
var RedisAIPool = sync.Pool{ New: func() interface{} { return &RedisAI{ HumanLabel: make([]byte, 0, 1024), HumanDescription: make([]byte, 0, 1024), RedisQuery: make([]byte, 0, 1024), } }, }
RedisAIPool is a sync.Pool of RedisAI Query types
Functions ¶
func Float32bytes ¶
func RandReferenceData ¶
func Uint64frombytes ¶
Types ¶
type BenchmarkRunner ¶
type BenchmarkRunner struct {
// contains filtered or unexported fields
}
LoadRunner contains the common components for running a inference benchmarking program against a database.
func NewBenchmarkRunner ¶
func NewBenchmarkRunner() *BenchmarkRunner
NewLoadRunner creates a new instance of LoadRunner which is common functionality to be used by inference benchmarker programs
func (*BenchmarkRunner) DatabaseName ¶
func (b *BenchmarkRunner) DatabaseName() string
ModelName returns the name of the database to run queries against
func (*BenchmarkRunner) DebugLevel ¶
func (b *BenchmarkRunner) DebugLevel() int
DebugLevel returns the level of debug messages for this benchmark
func (*BenchmarkRunner) DoPrintResponses ¶
func (b *BenchmarkRunner) DoPrintResponses() bool
DoPrintResponses indicates whether responses for queries should be printed
func (*BenchmarkRunner) GetBufferedReader ¶
func (b *BenchmarkRunner) GetBufferedReader() *bufio.Reader
GetBufferedReader returns the buffered Reader that should be used by the loader
func (*BenchmarkRunner) IgnoreErrors ¶
func (b *BenchmarkRunner) IgnoreErrors() bool
func (*BenchmarkRunner) Run ¶
func (b *BenchmarkRunner) Run(queryPool *sync.Pool, processorCreateFn ProcessorCreate, rowSizeBytes int)
Run does the bulk of the benchmark execution. It launches a gorountine to track stats, creates workers to process queries, read in the input, execute the queries, and then does cleanup.
func (*BenchmarkRunner) SetLimit ¶
func (b *BenchmarkRunner) SetLimit(limit uint64)
SetLimit changes the number of queries to run, with 0 being all of them
func (*BenchmarkRunner) UseReferenceDataMysql ¶
func (b *BenchmarkRunner) UseReferenceDataMysql() bool
func (*BenchmarkRunner) UseReferenceDataRedis ¶
func (b *BenchmarkRunner) UseReferenceDataRedis() bool
type LoadRunner ¶
type LoadRunner struct {
// contains filtered or unexported fields
}
LoadRunner contains the common components for running a inference benchmarking program against a database.
func NewLoadRunner ¶
func NewLoadRunner() *LoadRunner
NewLoadRunner creates a new instance of LoadRunner which is common functionality to be used by inference benchmarker programs
func (*LoadRunner) GetBufferedReader ¶
func (b *LoadRunner) GetBufferedReader() *bufio.Reader
GetBufferedReader returns the buffered Reader that should be used by the loader
func (*LoadRunner) RunLoad ¶
func (b *LoadRunner) RunLoad(queryPool *sync.Pool, LoaderCreateFn LoaderCreate, rowBenchmarkNBytes int)
Run does the bulk of the benchmark execution. It launches a gorountine to track stats, creates workers to process queries, read in the input, execute the queries, and then does cleanup.
func (*LoadRunner) SetLimit ¶
func (b *LoadRunner) SetLimit(limit uint64)
SetLimit changes the number of queries to run, with 0 being all of them
type Loader ¶
type Loader interface {
// Init initializes at global state for the Loader, possibly based on its worker number / ID
Init(workerNum int, wg *sync.WaitGroup)
// ProcessInferenceQuery handles a given inference and reports its stats
ProcessLoadQuery(q []byte, debug int) ([]*Stat, uint64, error)
Close()
}
Loader is an interface that handles the setup of a inference processing worker and executes queries one at a time
type LoaderCreate ¶
type LoaderCreate func() Loader
LoaderCreate is a function that creates a new Loader (called in Run)
type Processor ¶
type Processor interface {
// Init initializes at global state for the Loader, possibly based on its worker number / ID
Init(workerNum int, totalWorkers int, wg *sync.WaitGroup, m chan uint64, rs chan uint64)
// ProcessInferenceQuery handles a given inference and reports its stats
ProcessInferenceQuery(q []byte, isWarm bool, workerNum int, useReferenceDataRedis bool, useReferenceDataMysql bool, queryNumber int64) ([]*Stat, error)
// Close forces any work buffered to be sent to the DB being tested prior to going further
Close()
}
Loader is an interface that handles the setup of a inference processing worker and executes queries one at a time
type ProcessorCreate ¶
type ProcessorCreate func() Processor
LoaderCreate is a function that creates a new Loader (called in Run)
type RedisAI ¶
type RedisAI struct {
HumanLabel []byte
HumanDescription []byte
RedisQuery []byte
// contains filtered or unexported fields
}
RedisAI encodes a RedisAI request. This will be serialized for use by the aibench_run_inference_redisai program.
func (*RedisAI) HumanDescriptionName ¶
HumanDescriptionName returns the human readable description of this Query
func (*RedisAI) HumanLabelName ¶
HumanLabelName returns the human readable name of this Query