|
|
@ -476,9 +476,14 @@ func (th *TimeArrowHelper) GetHitTimeArrow(t time.Time, group string, expandTags |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
|
|
|
|
sliceStartTime := time.Now() |
|
|
|
sort.Slice(ta, func(i, j int) bool { |
|
|
|
return ta[i].Weights > ta[j].Weights |
|
|
|
}) |
|
|
|
log.Println("Slice排序耗时:", time.Since(sliceStartTime)) |
|
|
|
|
|
|
|
forStart := time.Now() |
|
|
|
for e := range ta { |
|
|
|
//当天具体时间判断
|
|
|
|
if !isInTimeOfDay(t, ta[e]) { |
|
|
@ -531,5 +536,7 @@ func (th *TimeArrowHelper) GetHitTimeArrow(t time.Time, group string, expandTags |
|
|
|
// log.Println("类型错误:", ta[e].Type)
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
log.Println("for循环耗时:", time.Since(forStart)) |
|
|
|
return nil, nil |
|
|
|
} |