This commit is contained in:
chenjiandongx 2020-05-09 21:56:32 +08:00
parent db0ab16315
commit 275ecdeacc
3 changed files with 8 additions and 11 deletions

View File

@ -33,31 +33,29 @@ func pushData(c *gin.Context) {
return
}
recvMetricValues := []*dataobj.MetricValue{}
var recvMetricValues []*dataobj.MetricValue
errors.Dangerous(c.ShouldBindJSON(&recvMetricValues))
err := funcs.Push(recvMetricValues)
render.Message(c, err)
return
}
func getStrategy(c *gin.Context) {
var resp []interface{}
port := stra.GetPortCollects()
for _, stra := range port {
resp = append(resp, stra)
for _, s := range port {
resp = append(resp, s)
}
proc := stra.GetProcCollects()
for _, stra := range proc {
resp = append(resp, stra)
for _, s := range proc {
resp = append(resp, s)
}
logStras := strategy.GetListAll()
for _, stra := range logStras {
resp = append(resp, stra)
for _, s := range logStras {
resp = append(resp, s)
}
render.Data(c, resp, nil)

View File

@ -349,7 +349,6 @@ func (gc *GlobalCounter) cleanStrategyData(id int64) {
return
}
sCount.TmsPoints = make(map[int64]*PointsCounter)
return
}
// countEqual意味着不会对统计的结构产生影响

View File

@ -211,7 +211,7 @@ func (w *Worker) producer(line string, strategy *stra.Strategy) (*AnalysPoint, e
t := reg.FindString(line)
if len(t) <= 0 {
return nil, errors.New(fmt.Sprintf("cannot get timestamp:[sname:%s][sid:%d][timeFormat:%v]", strategy.Name, strategy.ID, timeFormat))
return nil, fmt.Errorf("cannot get timestamp:[sname:%s][sid:%d][timeFormat:%v]", strategy.Name, strategy.ID, timeFormat)
}
// 如果没有年,需添加当前年