fix: inaccurate to report stats for total, feat: add average response time in total.

This commit is contained in:
徐聪
2022-01-19 19:55:06 +08:00
parent 573c2d79ad
commit 2f07c9ac0b
3 changed files with 57 additions and 36 deletions
+6 -1
View File
@@ -148,7 +148,7 @@ func (s *requestStats) collectReportData() map[string]interface{} {
"failed": s.transactionFailed,
}
data["stats"] = s.serializeStats()
data["stats_total"] = s.total.getStrippedReport()
data["stats_total"] = s.total.getReport()
data["errors"] = s.serializeErrors()
s.errors = make(map[string]*statsError)
return data
@@ -294,6 +294,11 @@ func (s *statsEntry) getStrippedReport() map[string]interface{} {
return report
}
func (s *statsEntry) getReport() map[string]interface{} {
report := s.serialize()
return report
}
type statsError struct {
name string
method string