mysql

package
v0.0.0-...-c12f8f0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package mysql gathers MySQL related data from a host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMysqlDumpSlow

func NewMysqlDumpSlow() readers.IReader

func NewMysqlInformationSchemaTables

func NewMysqlInformationSchemaTables() readers.IReader

func NewMysqlProcesslist

func NewMysqlProcesslist() readers.IReader

Types

type Base

type Base struct {
	HostAndPort string
	Retries     int
}

type DumpSlow

type DumpSlow struct {
	Count     int
	User      string
	Time      string
	Lock      string
	Rows      float64
	Statement string
}

type InformationSchemaTables

type InformationSchemaTables struct {
	Catalog              string        `db:"TABLE_CATALOG"`
	Schema               string        `db:"TABLE_SCHEMA"`
	Name                 string        `db:"TABLE_NAME"`
	Engine               string        `db:"ENGINE"`
	Version              int           `db:"VERSION"`
	RowFormat            string        `db:"ROW_FORMAT"`
	Rows                 uint64        `db:"TABLE_ROWS"`
	AvgRowLength         uint64        `db:"AVG_ROW_LENGTH"`
	DataLength           uint64        `db:"DATA_LENGTH"`
	MaxDataLength        uint64        `db:"MAX_DATA_LENGTH"`
	IndexLength          uint64        `db:"INDEX_LENGTH"`
	DataFree             uint64        `db:"DATA_FREE"`
	AutoIncrement        sql.NullInt64 `db:"AUTO_INCREMENT"`
	TableCollation       string        `db:"TABLE_COLLATION"`
	DataAndIndexLength   uint64
	DataAndIndexLengthMB float64
	DataAndIndexLengthGB float64
}

type MysqlDumpSlow

type MysqlDumpSlow struct {
	Data     map[string][]DumpSlow
	Options  string
	FilePath string
}

MysqlDumpSlow is a reader that parses mysqldumpslow output.

func (*MysqlDumpSlow) Run

func (m *MysqlDumpSlow) Run() error

func (*MysqlDumpSlow) ToJson

func (m *MysqlDumpSlow) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type MysqlInformationSchemaTables

type MysqlInformationSchemaTables struct {
	Data map[string][]InformationSchemaTables
	Base
}

MysqlInformationSchemaTables is a reader that fetch SHOW FULL PROCESSLIST data.

func (*MysqlInformationSchemaTables) Run

func (*MysqlInformationSchemaTables) ToJson

func (m *MysqlInformationSchemaTables) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type MysqlProcesslist

type MysqlProcesslist struct {
	Data map[string][]Processlist
	Base
}

MysqlProcesslist is a reader that fetch SHOW FULL PROCESSLIST data.

func (*MysqlProcesslist) Run

func (m *MysqlProcesslist) Run() error

func (*MysqlProcesslist) ToJson

func (m *MysqlProcesslist) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Processlist

type Processlist struct {
	Id           int            `db:"Id"`
	User         string         `db:"User"`
	Host         string         `db:"Host"`
	Db           sql.NullString `db:"db"`
	Command      string         `db:"Command"`
	Time         int            `db:"Time"`
	State        string         `db:"State"`
	Info         string         `db:"Info"`
	RowsSent     int            `db:"Rows_sent"`
	RowsExamined int            `db:"Rows_examined"`
}

Jump to

Keyboard shortcuts

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