Documentation ¶
Index ¶
- func GetDB(cnfPath string) (*sqlx.DB, error)
- func GetEngineINNODBStatus(ctx context.Context, db *sqlx.DB) (chan *data.MonitoredData, error)
- func GetEngineINNODBStatusTemplate() (*template.Template, error)
- func GetProcessList(ctx context.Context, db *sqlx.DB) (chan *data.MonitoredData, error)
- func GetSlaveStatus(ctx context.Context, db *sqlx.DB) (chan *data.MonitoredData, error)
- func GetThreads(ctx context.Context, db *sqlx.DB) (chan *data.MonitoredData, error)
- type ProcessList
- type SlaveStatusChan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDB ¶
GetDB returns the database connection that we want to monitor. Please make sure that the DB_* environment variables are set.
func GetEngineINNODBStatus ¶
GetEngineINNODBStatus returns the status of engine INNODB
func GetEngineINNODBStatusTemplate ¶
GetEngineINNODBStatusTemplate returns the template that can be used to parse the result of engine innodb as .txt
func GetProcessList ¶
GetProcessList returns a channel of entries pulled from the process list of the passed db.
func GetSlaveStatus ¶
GetSlaveStatus executes `show slave status` and returns it parsed in a struct.
func GetThreads ¶
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
Click to show internal directories.
Click to hide internal directories.