mysql

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDB

func GetDB(cnfPath string) (*sqlx.DB, error)

GetDB returns the database connection that we want to monitor. Please make sure that the DB_* environment variables are set.

func GetEngineINNODBStatus

func GetEngineINNODBStatus(ctx context.Context, db *sqlx.DB) (chan *data.MonitoredData, error)

GetEngineINNODBStatus returns the status of engine INNODB

func GetEngineINNODBStatusTemplate

func GetEngineINNODBStatusTemplate() (*template.Template, error)

GetEngineINNODBStatusTemplate returns the template that can be used to parse the result of engine innodb as .txt

func GetProcessList

func GetProcessList(ctx context.Context, db *sqlx.DB) (chan *data.MonitoredData, error)

GetProcessList returns a channel of entries pulled from the process list of the passed db.

func GetSlaveStatus

func GetSlaveStatus(ctx context.Context, db *sqlx.DB) (chan *data.MonitoredData, error)

GetSlaveStatus executes `show slave status` and returns it parsed in a struct.

func GetThreads

func GetThreads(ctx context.Context, db *sqlx.DB) (chan *data.MonitoredData, error)

GetThreads runs select * from p_s.threads

Types

type ProcessList

type ProcessList struct {
	ID           uint64         `gojay:"id" db:"id"`
	User         string         `gojay:"user" db:"user"`
	Host         string         `gojay:"host" db:"host"`
	DB           sql.NullString `gojay:"db" db:"db"`
	Command      string         `gojay:"command" db:"command"`
	Time         int64          `gojay:"time" db:"time"`
	State        sql.NullString `gojay:"state" db:"state"`
	Info         sql.NullString `gojay:"info" db:"info"`
	RowsSent     uint64         `gojay:"rows_sent" db:"rows_sent"`
	RowsExamined uint64         `gojay:"rows_examined" db:"rows_examined"`
}

type SlaveStatusChan

type SlaveStatusChan chan *data.SlaveStatus

func (SlaveStatusChan) IsNil

func (s SlaveStatusChan) IsNil() bool

Jump to

Keyboard shortcuts

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