mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
fix: inaccurate to report stats for total, feat: add average response time in total.
This commit is contained in:
@@ -58,14 +58,15 @@ func TestGetAvgContentLength(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetCurrentRps(t *testing.T) {
|
||||
duration := float64(3)
|
||||
numRequests := int64(6)
|
||||
currentRps := getCurrentRps(numRequests)
|
||||
currentRps := getCurrentRps(numRequests, duration)
|
||||
if currentRps != 2 {
|
||||
t.Error("currentRps should be 2")
|
||||
}
|
||||
|
||||
numRequests = int64(8)
|
||||
currentRps = getCurrentRps(numRequests)
|
||||
currentRps = getCurrentRps(numRequests, duration)
|
||||
if fmt.Sprintf("%.2f", currentRps) != "2.67" {
|
||||
t.Error("currentRps should be 2.67")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user