lib

package
v0.0.0-...-694989a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckQPSDropFromSysbenchOutputStream

func CheckQPSDropFromSysbenchOutputStream(reader io.Reader, threshold float64) (bool, string)

func CheckQPSDropFromSysbenchOutputText

func CheckQPSDropFromSysbenchOutputText(text string, threshold float64) (bool, string)

CheckQPSDropFromSysbenchOutputText parses a string as sysbench output and check if there exists abnormal QPS drop. A record is regarded as abnormal if it's QPS is less than threshold * average_qps_of_normal_records. Returns whether the check passed. If not, the second return value will be a string that contains all abnormal records.

func FormatRecord

func FormatRecord(record Record) string

func PlotQPS

func PlotQPS(records []Record, imageFilePath string) error

Types

type QPSDropRule

type QPSDropRule struct {
	// contains filtered or unexported fields
}

func (*QPSDropRule) Check

func (r *QPSDropRule) Check(records []Record) []Violation

func (*QPSDropRule) GetDescription

func (r *QPSDropRule) GetDescription() string

type Record

type Record struct {
	Second          int32
	Threads         int32
	TPS             float64
	QPS             float64
	ReadQPS         float64
	WriteQPS        float64
	OtherQPS        float64
	Latency         float64
	LatencyLimit    float64
	ErrorPerSec     float64
	ReconnectPerSec float64
}

func ParseRecord

func ParseRecord(str string) (Record, error)

type Rule

type Rule interface {
	Check(records []Record) []Violation
	GetDescription() string
}

func NewQPSDropRule

func NewQPSDropRule(threshold float64) Rule

NewQPSDropRule creates a rule that checks if there is a set of records with their QPS all less than threshold * average_of_others. No more than half of records will be put into the set.

type SysbenchAnalyzer

type SysbenchAnalyzer struct {
	// contains filtered or unexported fields
}

func NewSysbenchAnalyzer

func NewSysbenchAnalyzer(rules []Rule, ignoreInvalidLines bool) SysbenchAnalyzer

func (*SysbenchAnalyzer) AnalyzeParsedRecords

func (a *SysbenchAnalyzer) AnalyzeParsedRecords(records []Record) []Violation

func (*SysbenchAnalyzer) AnalyzeStream

func (a *SysbenchAnalyzer) AnalyzeStream(reader io.Reader) []Violation

func (*SysbenchAnalyzer) AnalyzeString

func (a *SysbenchAnalyzer) AnalyzeString(str string) []Violation

func (*SysbenchAnalyzer) ParseToEnd

func (a *SysbenchAnalyzer) ParseToEnd(reader io.Reader) ([]Record, []Violation)

type Violation

type Violation struct {
	ViolatedRule Rule
	RecordIndex  int
	RecordText   string
	Description  string
}

Jump to

Keyboard shortcuts

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