Skip to content

Commit

Permalink
[OWL-2005] Remove logging for debugging late-time alarm data
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Lue committed Dec 21, 2017
1 parent 567c578 commit 65dd61b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
10 changes: 0 additions & 10 deletions modules/alarm/cron/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func popEvent(queues []string) (*model.Event, error) {

log.Debug(event.String())
//insert event into database
go warningIfEventTooLate(5, &event)
err = eventmodel.InsertEvent(&event, "owl")
if err != nil {
log.Error(err.Error())
Expand Down Expand Up @@ -153,12 +152,3 @@ func popExternalEvent(queues []string) error {

return nil
}

func warningIfEventTooLate(minutes int, event *model.Event) {
now := time.Now()
eventTime := time.Unix(event.EventTime, 0)

if now.Sub(eventTime) >= (time.Duration(minutes) * time.Minute) {
log.Warnf("[DELAY DATA] Event [%v] is delay more than %d minutes. Now: %s. EventTime: %s", event, minutes, now, eventTime)
}
}
11 changes: 0 additions & 11 deletions modules/judge/store/judge.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"github.com/Cepave/open-falcon-backend/common/model"
"github.com/Cepave/open-falcon-backend/modules/judge/g"
"time"
)

func Judge(L *SafeLinkedList, firstItem *model.JudgeItem, now int64) {
Expand Down Expand Up @@ -81,7 +80,6 @@ func sendEvent(event *model.Event) {
rc := g.RedisConnPool.Get()
defer rc.Close()

go warningIfEventTooLate(5, event)
rc.Do("LPUSH", redisKey, string(bs))
}

Expand Down Expand Up @@ -243,12 +241,3 @@ func sendEventIfNeed(historyData []*model.HistoryData, isTriggered bool, now int
}
}
}

func warningIfEventTooLate(minutes int, event *model.Event) {
now := time.Now()
eventTime := time.Unix(event.EventTime, 0)

if now.Sub(eventTime) >= (time.Duration(minutes) * time.Minute) {
log.Warnf("[DELAY DATA] Event [%v] is delay more than %d minutes. Now: %s. EventTime: %s", event, minutes, now, eventTime)
}
}
13 changes: 0 additions & 13 deletions modules/transfer/sender/send_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ func forward2JudgeTask(Q *list.SafeListLimited, node string, concurrent int) {
var err error
sendOk := false
for i := 0; i < 3; i++ { //最多重试3次
go warningIfEventTooLate(5, judgeItems)
err = JudgeConnPools.Call(addr, "Judge.Send", judgeItems, resp)
if err == nil {
sendOk = true
Expand Down Expand Up @@ -353,15 +352,3 @@ func forward2StagingTask() {
}(stagingItems, count)
}
}

func warningIfEventTooLate(minutes int, metrics []*cmodel.JudgeItem) {
now := time.Now()

for _, metric := range metrics {
metricTime := time.Unix(metric.Timestamp, 0)

if now.Sub(metricTime) >= (time.Duration(minutes) * time.Minute) {
log.Warnf("[DELAY DATA] Metric [%v] is delay more than %d minutes. Now: %s. EventTime: %s", metric, minutes, now, metricTime)
}
}
}

0 comments on commit 65dd61b

Please sign in to comment.