stats

package
v0.0.0-...-e9efb70 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterReporter

func RegisterReporter(name string, r Reporter)

RegisterReporter registers the reporter with the unique name

Types

type DBStat

type DBStat struct {
	// Name is the unqiue name used in plotting later.
	Name string
	// DB is the database name
	DB string
	// Workload is the benchmark workload name
	Workload string
	// Summary holds the final output summary record
	// The key of the map is the operation in the benchmark.
	// E.g, in go-ycsb, the operation may be INSERT, READ
	Summary map[string]*Record

	// Progress holds the in progess record in benchmarking
	Progress map[string][]*Record
}

DBStat holds all statistics in one benchmark

func NewDBStat

func NewDBStat(name string, db string, workload string, pathName string) *DBStat

NewDBStat creates a DBStat. We assume we put all logs in one unique directory in each benchmark. E.g, we can use Git commit as the parent directory for benchmarking special version, use datetime for benchmarking different databases. If pathName is empty, we will use db as the name of DBStat.

func (*DBStat) Operations

func (s *DBStat) Operations() []string

Operations returns all the operations in the test

type DBStats

type DBStats []*DBStat

DBStats is the array of DBStat.

func (DBStats) Len

func (a DBStats) Len() int

func (DBStats) Less

func (a DBStats) Less(i, j int) bool

func (DBStats) Swap

func (a DBStats) Swap(i, j int)

type Record

type Record struct {
	OPS float64
	TPS float64
	QPS float64
	P99 float64
	P95 float64
}

Value saves the statistics value

func (*Record) Value

func (r *Record) Value(tp StatType) float64

Value returns the value of different statistics

type Reporter

type Reporter interface {
	// ParseName parses the db and workload from the result filename.
	// The filename format mostly is db_workload.log
	ParseName(fileName string) (db string, workload string)
	// NewDBStat parses the benchmark result file and saves the statistics into DBStat
	NewDBStat(name string, db string, workload string, filePath string) (*DBStat, error)
	// StatTypes returns the statistics we want to know
	StatTypes() []StatType
}

Reporter defines how to report your own benchmark tool result.

func GetReporter

func GetReporter(name string) Reporter

GetReporter gets the Reporter with the name

type StatType

type StatType int

StatType is the type of different statistics

const (
	None StatType = iota
	OPS
	P99
	P95
	TPS
	QPS
)

Different statistics for different benchmark tools.

func (StatType) String

func (s StatType) String() string

String returns the name of statistics

Jump to

Keyboard shortcuts

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