// Collect launches metrics collectors. // sql.DB is safe for concurrent use by multiple goroutines // so launching each metric collector as its own goroutine is safe func (s *MysqlStatDBs) Collect() { var queryFuncList = []func(){ s.GetVersion, s.GetSlaveStats, s.GetGlobalStatus, s.GetBinlogStats, s.GetStackedQueries, s.GetSessions, s.GetNumLongRunQueries, s.GetQueryResponseTime, s.GetBackups, s.GetOldestQuery, s.GetOldestTrx, s.GetBinlogFiles, s.GetInnodbStats, s.GetSecurity, s.GetSSL, } util.CollectInParallel(queryFuncList) }
// Collect collects various database/table metrics // sql.DB is thread safe so launching metrics collectors // in their own goroutines is safe func (s *MysqlStatUsers) Collect() { var queryFuncList = []func(){ s.GetUserStatistics, } util.CollectInParallel(queryFuncList) }