diff --git a/pkg/cmd/roachtest/kvbench.go b/pkg/cmd/roachtest/kvbench.go index f54b53969929..5af5451da428 100644 --- a/pkg/cmd/roachtest/kvbench.go +++ b/pkg/cmd/roachtest/kvbench.go @@ -314,18 +314,22 @@ func runKVBench(ctx context.Context, t *test, c *cluster, b kvBenchSpec) { } close(resultChan) res := <-resultChan - failErr := res.failureError(b) - if failErr == nil { - ttycolor.Stdout(ttycolor.Green) - t.l.Printf(`--- PASS: kv workload maintained an average latency of %0.1fms`+ - ` with avg throughput of %d`, res.latency(), res.throughput()) + + var color ttycolor.Code + var msg string + pass := res.latency() <= b.LatencyThresholdMs + if pass { + color = ttycolor.Green + msg = "PASS" } else { - ttycolor.Stdout(ttycolor.Red) - t.l.Printf(`--- FAIL: kv workload maintained an average latency of %0.1fms (threshold: %0.1fms)`+ - ` with avg throughput of %d`, res.latency(), b.LatencyThresholdMs, res.throughput()) + color = ttycolor.Red + msg = "FAIL" } + ttycolor.Stdout(color) + t.l.Printf(`--- SEARCH ITER %s: kv workload avg latency: %0.1fms (threshold: %0.1fms), avg throughput: %d`, + msg, res.latency(), b.LatencyThresholdMs, res.throughput()) ttycolor.Stdout(ttycolor.Reset) - return failErr == nil, nil + return pass, nil } if res, err := s.Search(searchPredicate); err != nil { t.Fatal(err) @@ -381,10 +385,3 @@ func (r kvBenchResult) throughput() int { // compute the average throughput here but not much more than that. return int(float64(r.Cumulative[`write`].TotalCount()) / r.Elapsed.Seconds()) } - -func (r kvBenchResult) failureError(b kvBenchSpec) error { - if r.latency() <= b.LatencyThresholdMs { - return nil - } - return errors.Errorf(`average latency is too high %0.1fms`, r.latency()) -} diff --git a/pkg/cmd/roachtest/tpcc.go b/pkg/cmd/roachtest/tpcc.go index 033504e5e102..b1fcae47ea2f 100644 --- a/pkg/cmd/roachtest/tpcc.go +++ b/pkg/cmd/roachtest/tpcc.go @@ -890,11 +890,11 @@ func runTPCCBench(ctx context.Context, t *test, c *cluster, b tpccBenchSpec) { // Print the result. if failErr == nil { ttycolor.Stdout(ttycolor.Green) - t.l.Printf("--- PASS: tpcc %d resulted in %.1f tpmC (%.1f%% of max tpmC)\n\n", + t.l.Printf("--- SEARCH ITER PASS: TPCC %d resulted in %.1f tpmC (%.1f%% of max tpmC)\n\n", warehouses, res.TpmC(), res.Efficiency()) } else { ttycolor.Stdout(ttycolor.Red) - t.l.Printf("--- FAIL: tpcc %d resulted in %.1f tpmC and failed due to %v", + t.l.Printf("--- SEARCH ITER FAIL: TPCC %d resulted in %.1f tpmC and failed due to %v", warehouses, res.TpmC(), failErr) } ttycolor.Stdout(ttycolor.Reset)