cockroach: Index | Files

package tpcc

import ""


Package Files

audit.go checks.go ddls.go delivery.go generate.go new_order.go order_status.go partition.go payment.go random.go result.go stock_level.go tpcc.go worker.go


const DeckWarehouseFactor = 12.605

DeckWarehouseFactor is the warehouse factor to be used with the workload deck implemented in this package. This value differs from the spec's provided value as the deck mechanism used by workload differs from the default workload but is an acceptable alternative. This is the default value.

The 12.605 is computed from the operation mix and the number of secs it takes to cycle through a deck:

10*(18+12) + 10*(3+12) + 1*(2+10) + 1*(2+5) + 1*(2+5) = 476

10 workers per warehouse times 10 newOrder ops per deck results in:

(10*10)/(476/60) = 12.605...
const PassingEfficiency = 85.0

PassingEfficiency is a percentage of the theoretical maximum tpmC required to pass TPC-C.

const SpecWarehouseFactor = 12.86

SpecWarehouseFactor is the default maximum per-warehouse newOrder throughput per second used to compute the maximum throughput value for a given warehouse count. This value is provided in the TPC-C spec.

func FromWarehouses Uses

func FromWarehouses(warehouses int) workload.Generator

FromWarehouses returns a tpcc generator pre-configured with the specified number of warehouses.

type Check Uses

type Check struct {
    Name string
    // If asOfSystemTime is non-empty it will be used to perform the check as
    // a historical query using the provided value as the argument to the
    // AS OF SYSTEM TIME clause.
    Fn        func(db *gosql.DB, asOfSystemTime string) error
    Expensive bool

Check is a tpcc consistency check.

func AllChecks Uses

func AllChecks() []Check

AllChecks returns a slice of all of the checks.

type Result Uses

type Result struct {

    // ActiveWarehouses is the number of warehouses used in the TPC-C run.
    ActiveWarehouses int

    // Cumulative maps from query name to the cumulative response time
    // histogram for the TPC-C run.
    Cumulative map[string]*hdrhistogram.Histogram

    // Elapsed is the amount of time captured by the Cumulative.
    Elapsed time.Duration

    // WarehouseFactor is the maximal number of newOrder transactions per second
    // per Warehouse. If zero it defaults to DeckWarehouseFactor which is derived
    // from this workload. The value is used to compute the efficiency of the run.
    WarehouseFactor float64

Result represents the outcome of a TPCC run.

func MergeResults Uses

func MergeResults(results ...*Result) *Result

MergeResults returns a result value constructed by merging the arguments. It should only be used if the number of ActiveWarehouses matches and will panic if they differ. Elapsed is computed as the max of all elapsed values and makes the assumption that the distributions roughly overlap in time. This should be used when merging from multiple load generators during the same test run.

func NewResult Uses

func NewResult(
    activeWarehouses int,
    warehouseFactor float64,
    elapsed time.Duration,
    cumulative map[string]*hdrhistogram.Histogram,
) *Result

NewResult constructs a new Result.

func NewResultWithSnapshots Uses

func NewResultWithSnapshots(
    activeWarehouses int, warehouseFactor float64, snapshots map[string][]histogram.SnapshotTick,
) *Result

NewResultWithSnapshots creates a new result from a deserialized set of histogram snapshots.

func (*Result) Efficiency Uses

func (r *Result) Efficiency() float64

Efficiency returns the efficiency of a TPC-C run. It relies on the WarehouseFactor which defaults to DeckWarehouseFactor.

func (*Result) FailureError Uses

func (r *Result) FailureError() error

FailureError returns nil if the Result is passing or an error describing the failure if the result is failing.

func (*Result) TpmC Uses

func (r *Result) TpmC() float64

TpmC returns a tpmC value with a warehouse factor of 12.86. TpmC will panic if r does not contain a "newOrder" histogram in Cumulative.

Package tpcc imports 31 packages (graph) and is imported by 24 packages. Updated 2020-08-09. Refresh now. Tools for package owners.