|
|
@ -49,18 +49,19 @@ func (the *consumerHBJCAS) InputInitial() error { |
|
|
|
the.monitor = &monitors.CommonMonitor{ |
|
|
|
MonitorHelper: &monitors.MonitorHelper{}, |
|
|
|
} |
|
|
|
|
|
|
|
the.monitor.Start() |
|
|
|
for taskName, cron := range the.Info.Monitor { |
|
|
|
switch taskName { |
|
|
|
case "cron10min": |
|
|
|
the.monitor.RegisterTask(cron, the.getEs1HourAggData) |
|
|
|
case "cron1hour": |
|
|
|
the.monitor.RegisterTask(cron, the.getEs10minAggData) |
|
|
|
case "cron1hour": |
|
|
|
the.monitor.RegisterTask(cron, the.getEs1HourAggData) |
|
|
|
default: |
|
|
|
log.Printf("定时任务[%s],cron=[%s] 无匹配", taskName, cron) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
the.monitor.Start() |
|
|
|
return nil |
|
|
|
} |
|
|
|
func (the *consumerHBJCAS) OutputInitial() error { |
|
|
@ -141,7 +142,8 @@ func (the *consumerHBJCAS) getEs1HourAggData() { |
|
|
|
} |
|
|
|
|
|
|
|
func (the *consumerHBJCAS) getEs10minAggData() { |
|
|
|
start, end := utils.GetTimeRangeBy10min() |
|
|
|
//utils.GetTimeRangeBy10min() 由于振动数据
|
|
|
|
start, end := utils.GetTimeRangeByHour(-1) |
|
|
|
log.Printf("查询数据时间范围 %s - %s", start, end) |
|
|
|
factorIds := []int{28} |
|
|
|
structIds := the.getStructIds() |
|
|
|