Skip to content

Commit

Permalink
round computed rate in real-traffic-test
Browse files Browse the repository at this point in the history
  • Loading branch information
maschmid committed Nov 29, 2024
1 parent 5717d19 commit 8eed01e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/performance/benchmarks/real-traffic-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"flag"
"fmt"
"log"
"math"
"math/rand"
"net/http"
"os"
Expand Down Expand Up @@ -298,7 +299,7 @@ func checkSLA(results *vegeta.Metrics, rate vegeta.ConstantPacer) error {
}

// SLA 2: making sure the defined vegeta rates is met
if results.Rate == rate.Rate(time.Second) {
if math.Round(results.Rate) == rate.Rate(time.Second) {
log.Printf("SLA 2 passed. vegeta rate is %f", rate.Rate(time.Second))
} else {
return fmt.Errorf("SLA 2 failed. vegeta rate is %f, expected Rate is %f", results.Rate, rate.Rate(time.Second))
Expand Down

0 comments on commit 8eed01e

Please sign in to comment.