Documentation
¶
Index ¶
- Constants
- func CheckIfMysqlAliveError(err error) bool
- func CheckMysqlAlive(db *sql.DB, querySql string) bool
- func GetErrorNumber(err error) (uint16, bool)
- func GetPidOfMysql(pidFile string) (int32, error)
- func MergeMapUint64(dst map[string]uint64, src map[string]uint64) map[string]uint64
- func MysqlShowGlobalStatus(db *sql.DB) (map[string]int64, error)
- func MysqlShowInnodbStatus(db *sql.DB) (map[string]uint64, error)
- func ParseInnodbStatusFileIO(line string) map[string]uint64
- func ParseInnodbStatusLog(line string) map[string]uint64
- func ParseInnodbStatusRowOperation(line string) map[string]uint64
- func ParseInnodbStatusSemaphores(line string) map[string]uint64
- func ParseInnodbStatusTransactions(line string) map[string]uint64
- func StillAliveErrorNumb(numb uint16) bool
- type MySQLSalveStatus
- type MysqlConCfg
- func (my *MysqlConCfg) BuildMysqlUrl() string
- func (my *MysqlConCfg) CreateMysqlCon() (*sql.DB, error)
- func (my *MysqlConCfg) CreateMysqlConMultiTimes(cnt int) (*sql.DB, error)
- func (my *MysqlConCfg) CreateMysqlConMultiTimesInterval(cnt int, interval int) (*sql.DB, error)
- func (my *MysqlConCfg) SetMyConDefaultConConfNotOverwrite()
- func (my *MysqlConCfg) SetMyConDefaultConConfOverwrite()
- type MysqlVars
Constants ¶
View Source
const ( C_mysql_alive_query string = "select 1" C_mysql_sql_global_status string = "show global status" C_mysql_sql_global_vars string = "show global variables" C_mysql_sql_slave_status string = "show slave status" C_mysql_sql_slave_status_all string = "show all slaves status" C_mysql_sql_innodb_status string = "show engine innodb status" )
Variables ¶
This section is empty.
Functions ¶
func CheckIfMysqlAliveError ¶
func GetErrorNumber ¶
func GetPidOfMysql ¶
func MergeMapUint64 ¶
func ParseInnodbStatusFileIO ¶
5.5 Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] , ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0 Pending flushes (fsync) log: 0; buffer pool: 0 11990 OS file reads, 279717 OS file writes, 248633 OS fsyncs
5.7 Pending normal aio reads: [0, 0, 0, 0, 0, 0, 0, 0] , aio writes: [0, 0, 0, 0, 0, 0, 0, 0] , ibuf aio reads:, log i/o's:, sync i/o's: Pending flushes (fsync) log: 0; buffer pool: 0 446 OS file reads, 272985 OS file writes, 2974 OS fsyncs 0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
func ParseInnodbStatusLog ¶
func StillAliveErrorNumb ¶
Types ¶
type MySQLSalveStatus ¶
type MySQLSalveStatus struct {
Is_Slave bool
Master_Host string
Master_Port int32
Master_User string
Master_Password string
Master_Log_File string
Read_Master_Log_Pos uint64
Relay_Log_File string
Relay_Log_Pos uint64
Relay_Master_Log_File string
Exec_Master_Log_Pos uint64
Relay_Log_Space uint64
Slave_IO_Running bool
Slave_SQL_Running bool
Seconds_Behind_Master uint64
Master_UUID string
Auto_Position int32
Retrieved_Gtid_Set string
Executed_Gtid_Set string
Replicate_Do_DB string
Replicate_Ignore_DB string
Replicate_Do_Table string
Replicate_Ignore_Table string
Replicate_Wild_Do_Table string
Replicate_Wild_Ignore_Table string
Replicate_Ignore_Server_Ids string
Master_Server_Id int32
Until_Condition string
Until_Log_File string
Until_Log_Pos uint64
Last_Errno int32
Last_Error string
Last_IO_Errno int32
Last_IO_Error string
Last_IO_Error_Timestamp int32
Last_SQL_Errno int32
Last_SQL_Error string
Last_SQL_Error_Timestamp int32
}
func MysqlShowSlaveStatusStr ¶
func MysqlShowSlaveStatusStr(db *sql.DB) (MySQLSalveStatus, error)
type MysqlConCfg ¶
type MysqlConCfg struct {
Host string
Port int
Socket string
User string
Password string
DefaultDb string
WriteTimeout int
ReadTimeout int
Timeout int
ParseTime bool
Location string
AutoCommit bool
MyUrl string
// contains filtered or unexported fields
}
func (*MysqlConCfg) BuildMysqlUrl ¶
func (my *MysqlConCfg) BuildMysqlUrl() string
func (*MysqlConCfg) CreateMysqlCon ¶
func (my *MysqlConCfg) CreateMysqlCon() (*sql.DB, error)
even error, db is not nil , you have to close it (db.close)
if db != nil {
db.Close()
func (*MysqlConCfg) CreateMysqlConMultiTimes ¶
func (my *MysqlConCfg) CreateMysqlConMultiTimes(cnt int) (*sql.DB, error)
func (*MysqlConCfg) CreateMysqlConMultiTimesInterval ¶
func (*MysqlConCfg) SetMyConDefaultConConfNotOverwrite ¶
func (my *MysqlConCfg) SetMyConDefaultConConfNotOverwrite()
func (*MysqlConCfg) SetMyConDefaultConConfOverwrite ¶
func (my *MysqlConCfg) SetMyConDefaultConConfOverwrite()
Click to show internal directories.
Click to hide internal directories.