diff --git a/src/modules/collector/collector.go b/src/modules/collector/collector.go index c061788d..cda28c40 100644 --- a/src/modules/collector/collector.go +++ b/src/modules/collector/collector.go @@ -72,7 +72,6 @@ func main() { funcs.BuildMappers() funcs.Collect() - stra.GetCollects() //插件采集 plugins.Detect() diff --git a/src/modules/transfer/backend/query.go b/src/modules/transfer/backend/query.go index 34bb9a3f..25f689f3 100644 --- a/src/modules/transfer/backend/query.go +++ b/src/modules/transfer/backend/query.go @@ -96,15 +96,15 @@ func FetchDataForUI(input dataobj.QueryDataForUI) []*dataobj.TsdbQueryResponse { //进行数据计算 aggrDatas := []*dataobj.TsdbQueryResponse{} if input.AggrFunc != "" && len(resp) > 1 { - aggrData := &dataobj.TsdbQueryResponse{ - Start: input.Start, - End: input.End, - } aggrCounter := make(map[string][]*dataobj.TsdbQueryResponse) if len(input.GroupKey) == 0 || getTags(resp[0].Counter) == "" { + aggrData := &dataobj.TsdbQueryResponse{ + Start: input.Start, + End: input.End, + Values: calc.Compute(input.AggrFunc, resp), + } //没有聚合 tag, 或者曲线没有其他 tags, 直接所有曲线进行计算 - aggrData.Values = calc.Compute(input.AggrFunc, resp) aggrDatas = append(aggrDatas, aggrData) } else { for _, data := range resp { @@ -133,9 +133,12 @@ func FetchDataForUI(input dataobj.QueryDataForUI) []*dataobj.TsdbQueryResponse { } for counter, datas := range aggrCounter { - aggrData.Counter = counter - aggrData.Values = calc.Compute(input.AggrFunc, datas) - + aggrData := &dataobj.TsdbQueryResponse{ + Start: input.Start, + End: input.End, + Counter: counter, + Values: calc.Compute(input.AggrFunc, datas), + } aggrDatas = append(aggrDatas, aggrData) } }