还原结果处理函数

This commit is contained in:
wh_zcy 2022-12-14 19:58:16 +08:00
parent 156666e1b7
commit 69339fe16c

View File

@ -311,22 +311,9 @@ func (m *Robot) processResult() {
statis.AvgElapse = avg statis.AvgElapse = avg
routes[head] = statis routes[head] = statis
} }
m.ReportMap[r.Num] = routes
if r.Elapse < min {
min = r.Elapse
}
statis := &Statistics{
Route: head,
SceneName: r.SceneName,
ElapseTotal: route.ElapseTotal + r.Elapse,
MaxElapse: max,
MinElapse: min,
CallCount: route.CallCount + 1,
}
avg := (statis.MaxElapse + statis.MinElapse) / 2
statis.AvgElapse = avg
routes[head] = statis
} else { } else {
route := make(map[string]*Statistics)
statis := &Statistics{ statis := &Statistics{
Route: head, Route: head,
SceneName: r.SceneName, SceneName: r.SceneName,
@ -337,23 +324,9 @@ func (m *Robot) processResult() {
} }
avg := (statis.MaxElapse + statis.MinElapse) / 2 avg := (statis.MaxElapse + statis.MinElapse) / 2
statis.AvgElapse = avg statis.AvgElapse = avg
routes[head] = statis route[head] = statis
m.ReportMap[r.Num] = route
} }
m.ReportMap[r.Num] = routes
} else {
route := make(map[string]*Statistics)
statis := &Statistics{
Route: head,
SceneName: r.SceneName,
ElapseTotal: r.Elapse,
MaxElapse: r.Elapse,
MinElapse: r.Elapse,
CallCount: 1,
}
avg := (statis.MaxElapse + statis.MinElapse) / 2
statis.AvgElapse = avg
route[head] = statis
m.ReportMap[r.Num] = route
} }
}() }()