db

package
v0.0.0-...-3fa081e Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProcessListLabels

func GetProcessListLabels() []string

Types

type MySQLMonitor

type MySQLMonitor struct {
	QueryFilter string
	UserFilter  string
	TimeFilter  string
	ProcessList ProcessList
	// contains filtered or unexported fields
}

func NewMySQLMonitor

func NewMySQLMonitor(o *Options) *MySQLMonitor

func (*MySQLMonitor) Connect

func (m *MySQLMonitor) Connect(ctx context.Context) (err error)

func (*MySQLMonitor) GetProcessColumnCount

func (m *MySQLMonitor) GetProcessColumnCount() (int, error)

func (*MySQLMonitor) Kill

func (m *MySQLMonitor) Kill(pid int) error

func (*MySQLMonitor) ShowGlobalStatus

func (m *MySQLMonitor) ShowGlobalStatus(ctx context.Context) error

func (*MySQLMonitor) ShowProcessList

func (m *MySQLMonitor) ShowProcessList(ctx context.Context) (ProcessList, error)

func (*MySQLMonitor) SortColumn

func (m *MySQLMonitor) SortColumn() int

func (*MySQLMonitor) ToggleSortColumn

func (m *MySQLMonitor) ToggleSortColumn()

type Options

type Options struct {
	// mysql, but we could support postgres... sometime
	Driver string

	// connection credentials
	Hostname string
	Username string
	Password string
	Database string
	Port     string

	// polling interval
	Delay int

	// skip idle connections
	SkipIdle bool
}

func NewOptions

func NewOptions() *Options

func (*Options) Bind

func (o *Options) Bind() *Options

type Process

type Process struct {
	Id           uint64         `db:"ID"`
	Host         string         `db:"HOST"`
	User         string         `db:"USER"`
	Db           sql.NullString `db:"DB"`
	Command      string         `db:"COMMAND"`
	Time         int            `db:"TIME"`
	TimeMS       uint64         `db:"TIME_MS"`
	State        sql.NullString `db:"STATE"`
	Info         sql.NullString `db:"INFO"`
	RowsRead     uint64         `db:"ROWS_READ"`
	RowsSent     uint64         `db:"ROWS_SENT"`
	RowsExamined uint64         `db:"ROWS_EXAMINED"`
}

func (*Process) GetValueByLabel

func (p *Process) GetValueByLabel(label string) string

type ProcessList

type ProcessList []Process

Jump to

Keyboard shortcuts

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