Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachtest: remove confusing "--- PASS" log lines #52273

Merged
merged 1 commit into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions pkg/cmd/roachtest/kvbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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())
}
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/tpcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down