还原结果处理函数
This commit is contained in:
parent
156666e1b7
commit
69339fe16c
35
lib/robot.go
35
lib/robot.go
@ -311,22 +311,9 @@ func (m *Robot) processResult() {
|
||||
statis.AvgElapse = avg
|
||||
routes[head] = statis
|
||||
}
|
||||
|
||||
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
|
||||
m.ReportMap[r.Num] = routes
|
||||
} else {
|
||||
route := make(map[string]*Statistics)
|
||||
statis := &Statistics{
|
||||
Route: head,
|
||||
SceneName: r.SceneName,
|
||||
@ -337,23 +324,9 @@ func (m *Robot) processResult() {
|
||||
}
|
||||
avg := (statis.MaxElapse + statis.MinElapse) / 2
|
||||
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
|
||||
}
|
||||
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user