Skip to content

Commit

Permalink
fix default value and SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdWaterLW committed Jul 24, 2020
1 parent 8308814 commit 1d0096d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ relay_log_space: 取所有通道的relay_log_space的和
| query_rt10ms| performance_schema.events_statements_summary_by_digest|
| query_rt1ms|performance_schema.events_statements_summary_by_digest|
| query_avgrt |performance_schema.events_statements_summary_by_digest|
| read_only | SHOW /*!50002 GLOBAL */ STATUS|
| read_only | SHOW VARIABLES|
| server_id | SHOW VARIABLES|
| uncommitted_trx_duration_top_1 |information_schema.processlist and information_schema.innodb_trx|
| uncommitted_trx_duration_top_2 |information_schema.processlist and information_schema.innodb_trx|
Expand Down
6 changes: 3 additions & 3 deletions actiontech_mysql_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var (
procs = flag.Bool("procs", true, "Whether to check SHOW PROCESSLIST")
getQrtPercona = flag.Bool("get_qrt_percona", true, "Whether to get response times from Percona Server or MariaDB")
getQrtMysql = flag.Bool("get_qrt_mysql", false, "Whether to get response times from MySQL (default: false)")
getUcTrxDurMysql = flag.Bool("get_uctrx_dur_mysql", true, "Whether to get uncommitted transaction duration from MySQL (default: false)")
getUcTrxDurMysql = flag.Bool("get_uctrx_dur_mysql", true, "Whether to get uncommitted transaction duration from MySQL (default: true)")
discoveryPort = flag.Bool("discovery_port", false, "`discovery mysqld port`, print in json format (default: false)")
useSudo = flag.Bool("sudo", true, "Use `sudo netstat...`")
version = flag.Bool("version", false, "print version")
Expand Down Expand Up @@ -174,7 +174,7 @@ func collect() ([]bool, []map[string]string) {

// Collecting ...
collectionInfo := make([]map[string]string, 9)
collectionExist := []bool{true, true, false, false, false, false, false, false, true}
collectionExist := []bool{true, true, false, false, false, false, false, false, false}

collectionInfo[SHOW_STATUS] = collectAllRowsToMap("variable_name", "value", db, "SHOW /*!50002 GLOBAL */ STATUS")
collectionInfo[SHOW_VARIABLES] = collectAllRowsToMap("variable_name", "value", db, "SHOW VARIABLES")
Expand Down Expand Up @@ -244,7 +244,7 @@ func collect() ([]bool, []map[string]string) {
[]string{"state"}, db, "SHOW PROCESSLIST")

timeCollection := collectMultiColumnAllRowsAsMapValue([]string{SHOW_PROCESSLIST_TIME_PRE},
[]string{"time"}, db, "SELECT time FROM INFORMATION_SCHEMA.PROCESSLIST WHERE state NOT IN ('','sleep') AND user NOT IN ('root','repl') AND db != 'NULL'")
[]string{"time"}, db, "SELECT time FROM INFORMATION_SCHEMA.PROCESSLIST WHERE state NOT IN ('','sleep') AND user != 'root' AND db != 'NULL'")
stringMapAdd(collectionInfo[SHOW_PROCESSLIST], stateCollection)
stringMapAdd(collectionInfo[SHOW_PROCESSLIST], timeCollection)

Expand Down

0 comments on commit 1d0096d

Please sign in to comment.