cockroachdb / loadgen

CockroachDB load generators
Apache License 2.0
30 stars 25 forks source link

tpcc: add auditor and initial check #173

Closed solongordon closed 6 years ago

solongordon commented 6 years ago

I added some basic auditing functionality to the TPC-C workload. This is similar to the existing checks in checks.go, but rather than querying the db it relies on statistics which are gathered as the workload runs. Right now the audit checks are performed only when the workload exits, but in the future we could also consider running them periodically as it runs.

Refers #151

cockroach-teamcity commented 6 years ago

This change is Reviewable

rjnn commented 6 years ago

:lgtm: Great start!


Reviewed 8 of 8 files at r1. Review status: all files reviewed at latest revision, 1 unresolved discussion.


tpcc/audit.go, line 39 at r1 (raw file):

  // result of an unused item number.
  orders := atomic.LoadUint64(&a.newOrderTransactions)
  if orders < 0 {

less than zero?


Comments from Reviewable

solongordon commented 6 years ago

Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


tpcc/audit.go, line 39 at r1 (raw file):

Previously, arjunravinarayan (Arjun Narayan) wrote…
less than zero?

Oops good catch. :) Switched this for testing and forgot to change it back.


Comments from Reviewable

rjnn commented 6 years ago

:shipit:


Reviewed 1 of 1 files at r2. Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

jordanlewis commented 6 years ago

The spec technically requires reporting all of these statistics at the end of the run even if we passed them, so it could be good to get these printed to stdout at the end. I'd be happy leaving that to a future PR though.

solongordon commented 6 years ago

Noted, thanks @jordanlewis.