diff --git a/src/models/mon_stra.go b/src/models/mon_stra.go index 945b383f..698710e7 100644 --- a/src/models/mon_stra.go +++ b/src/models/mon_stra.go @@ -506,7 +506,7 @@ func (s *Stra) Decode() error { return err } - s.NotifyUserDetail, err = UserGets(s.NotifyUser, 10000, 0, "") + s.NotifyUserDetail, err = UserGetsByIds(s.NotifyUser) if err != nil { logger.Errorf("decode strategy(%d) on NotifyUserDetail fail: %v", s.Id, err) return err diff --git a/src/models/user.go b/src/models/user.go index 699ef852..208214ef 100644 --- a/src/models/user.go +++ b/src/models/user.go @@ -341,6 +341,12 @@ func UserTotal(ids []int64, where string, args ...interface{}) (int64, error) { return session.Count(new(User)) } +func UserGetsByIds(ids []int64) ([]User, error) { + var users []User + err := DB["rdb"].In("id", ids).Find(&users) + return users, err +} + func UserGets(ids []int64, limit, offset int, where string, args ...interface{}) ([]User, error) { session := DB["rdb"].Limit(limit, offset).OrderBy("username") if len(ids) > 0 { diff --git a/src/modules/agent/statsd/statsd_reporter.go b/src/modules/agent/statsd/statsd_reporter.go index 3e11bf75..f0285d0c 100644 --- a/src/modules/agent/statsd/statsd_reporter.go +++ b/src/modules/agent/statsd/statsd_reporter.go @@ -90,7 +90,7 @@ func (self StatsdReporter) handleActions(actions []action) { switch action.actionType { case "report": previousState := StatsdState{}.RollState() - //previousState.Summarize() // 指标进一步聚合,得到类似的tag值 + previousState.Summarize() // 指标进一步聚合,得到类似的tag值 // 第一个统计周期不准确, 扔掉 if isFirstPeriod {