package proc import ( nproc "github.com/niean/gotools/proc" "log" ) // 监控 var ( MonitorCronCnt = nproc.NewSCounterQps("MonitorCronCnt") MonitorConcurrentErrorCnt = nproc.NewSCounterQps("MonitorConcurrentErrorCnt") MonitorAlarmMailCnt = nproc.NewSCounterQps("MonitorAlarmMailCnt") MonitorAlarmSmsCnt = nproc.NewSCounterQps("MonitorAlarmSmsCnt") MonitorAlarmCallbackCnt = nproc.NewSCounterQps("MonitorAlarmCallbackCnt") ) func Start() { log.Println("proc:Start ok") } func GetAll() []interface{} { ret := make([]interface{}, 0) // monitor ret = append(ret, MonitorCronCnt.Get()) ret = append(ret, MonitorConcurrentErrorCnt.Get()) ret = append(ret, MonitorAlarmMailCnt.Get()) ret = append(ret, MonitorAlarmSmsCnt.Get()) ret = append(ret, MonitorAlarmCallbackCnt.Get()) return ret
package proc import ( nproc "github.com/niean/gotools/proc" "log" ) // 统计指标的整体数据 var ( // judge status query cnt JudgeStatusQuery = nproc.NewSCounterQps("JudgeStatusQuery") JudgeStatusesQuery = nproc.NewSCounterQps("JudgeStatusesQuery") ) func Start() { log.Println("proc.Start, ok") } func GetAll() []interface{} { ret := make([]interface{}, 0) ret = append(ret, JudgeStatusQuery.Get()) ret = append(ret, JudgeStatusesQuery.Get()) return ret }
package proc import ( nproc "github.com/niean/gotools/proc" "log" ) // trace var ( trace *nproc.DataTrace ) // counter var ( HttpRequestCnt = nproc.NewSCounterQps("HttpRequestCnt") MailSendCnt = nproc.NewSCounterQps("MailSendCnt") MailSendOkCnt = nproc.NewSCounterQps("MailSendOkCnt") MailSendErrCnt = nproc.NewSCounterQps("MailSendErrCnt") ) func Start() { log.Println("proc.Start, ok") } func GetAll() []interface{} { ret := make([]interface{}, 0) ret = append(ret, HttpRequestCnt) ret = append(ret, MailSendCnt)