perfschema

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDigestRows

func GetDigestRows(mysqlConn mysql.Connector, lastFetchSeconds float64, c chan<- *DigestRow, doneChan chan<- error) error

GetDigestRows connects to MySQL through `mysql.Connector`, fetches snapshot of data from events_statements_summary_by_digest, delivers it over a channel, and notifies success or error through `doneChan`. If `lastFetchSeconds` equals `-1` then it fetches all data, not just since `lastFetchSeconds`.

Types

type Class

type Class struct {
	DigestText string
	Rows       map[string]*DigestRow // keyed on schema
}

A Class represents a single query and its per-schema instances.

type DigestRow

type DigestRow struct {
	Schema                  string
	Digest                  string
	DigestText              string
	CountStar               uint
	SumTimerWait            uint64
	MinTimerWait            uint64
	AvgTimerWait            uint64
	MaxTimerWait            uint64
	SumLockTime             uint64
	SumErrors               uint64
	SumWarnings             uint64
	SumRowsAffected         uint64
	SumRowsSent             uint64
	SumRowsExamined         uint64
	SumCreatedTmpDiskTables uint64 // bool in slow log
	SumCreatedTmpTables     uint64 // bool in slow log
	SumSelectFullJoin       uint64 // bool in slow log
	SumSelectFullRangeJoin  uint64
	SumSelectRange          uint64
	SumSelectRangeCheck     uint64
	SumSelectScan           uint64 // bool in slow log
	SumSortMergePasses      uint64
	SumSortRange            uint64
	SumSortRows             uint64
	SumSortScan             uint64
	SumNoIndexUsed          uint64
	SumNoGoodIndexUsed      uint64
}

A DigestRow is a row from performance_schema.events_statements_summary_by_digest.

type Digests

type Digests struct {
	// All digests collected from performance_schema since creation of Digests or Reset()
	All Snapshot
	// Curr digests collected from performance_schema
	Curr Snapshot
}

Digests represents digests retrieved from performance_schema

func NewDigests

func NewDigests() *Digests

NewDigests returns ready to use *Digests

func (*Digests) MergeCurr

func (d *Digests) MergeCurr()

MergeCurr merges current snapshot into all collected digests so far

func (*Digests) Reset

func (d *Digests) Reset()

Reset drops all collected data

type GetDigestRowsFunc

type GetDigestRowsFunc func(c chan<- *DigestRow, lastFetchSeconds float64, doneChan chan<- error) error

type Iter

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

func NewIter

func NewIter(logger *pct.Logger, tickChan chan time.Time) *Iter

func (*Iter) IntervalChan

func (i *Iter) IntervalChan() chan *iter.Interval

func (*Iter) Start

func (i *Iter) Start()

func (*Iter) Stop

func (i *Iter) Stop()

func (*Iter) TickChan

func (i *Iter) TickChan() chan time.Time

type RealWorkerFactory

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

func NewRealWorkerFactory

func NewRealWorkerFactory(logChan chan proto.LogEntry) *RealWorkerFactory

func (*RealWorkerFactory) Make

func (f *RealWorkerFactory) Make(name string, mysqlConn mysql.Connector) *Worker

type Snapshot

type Snapshot map[string]Class // keyed on digest (classId)

A Snapshot represents all rows from performance_schema.events_statements_summary_by_digest at a single time, grouped by digest into classes. Two consecutive Snapshots are needed to produce a mysqlAnalyzer.Result.

type Worker

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

func NewWorker

func NewWorker(logger *pct.Logger, mysqlConn mysql.Connector, getRows GetDigestRowsFunc) *Worker

func (*Worker) Cleanup

func (w *Worker) Cleanup() error

func (*Worker) Run

func (w *Worker) Run() (*report.Result, error)

func (*Worker) SetConfig

func (w *Worker) SetConfig(config pc.QAN)

func (*Worker) Setup

func (w *Worker) Setup(interval *iter.Interval) error

func (*Worker) Status

func (w *Worker) Status() map[string]string

func (*Worker) Stop

func (w *Worker) Stop() error

type WorkerFactory

type WorkerFactory interface {
	Make(name string, mysqlConn mysql.Connector) *Worker
}

Jump to

Keyboard shortcuts

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