Documentation
¶
Index ¶
- func ConnCheck(db *sql.DB) error
- type CompositeWork
- func NewDeleteRowWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
- func NewDeleteTxnWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
- func NewInsertRowWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
- func NewInsertTxnWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
- func NewSelectByPkRowWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
- func NewSelectByPkTxnWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
- func NewSelectByUkRowWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
- func NewSelectByUkTxnWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
- func NewUpdateRowWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
- func NewUpdateTxnWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
- type CompositeWorkFactory
- type DeleteRowWork
- type DeleteTxnWork
- type InsertRowWork
- type InsertTxnWork
- type RunParams
- type SelectByPkRowWork
- type SelectByPkTxnWork
- type SelectByUkRowWork
- type SelectByUkTxnWork
- type UpdateRowWork
- type UpdateTxnWork
- type WorkAllocationStrategy
- type Worker
- type WorkerResult
- type Workload
- func NewDeleteRowWorkload(assignedRange *intgen.Range, rp *RunParams) *Workload
- func NewDeleteTxnWorkload(assignedRange *intgen.Range, rp *RunParams) *Workload
- func NewInsertRowWorkload(assignedRange *intgen.Range, rp *RunParams) *Workload
- func NewInsertTxnWorkload(assignedRange *intgen.Range, rp *RunParams) *Workload
- func NewSelectByPkRowWorkload(assignedRange *intgen.Range, rp *RunParams) *Workload
- func NewSelectByPkTxnWorkload(assignedRange *intgen.Range, rp *RunParams) *Workload
- func NewSelectByUkRowWorkload(assignedRange *intgen.Range, rp *RunParams) *Workload
- func NewSelectByUkTxnWorkload(assignedRange *intgen.Range, rp *RunParams) *Workload
- func NewUpdateRowWorkload(assignedRange *intgen.Range, rp *RunParams) *Workload
- func NewUpdateTxnWorkload(assignedRange *intgen.Range, rp *RunParams) *Workload
- func NewWorkload(name string, rp *RunParams) *Workload
- type WorkloadResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompositeWork ¶
type CompositeWork interface {
// DoNext executes the next sub part of the work. It returns false when all sub parts are done
DoNext() (hasMore bool, err error)
}
CompositeWork represents a unit work that has multiple sub parts
func NewDeleteRowWork ¶
func NewDeleteRowWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
func NewDeleteTxnWork ¶
func NewDeleteTxnWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
func NewInsertRowWork ¶
func NewInsertRowWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
func NewInsertTxnWork ¶
func NewInsertTxnWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
func NewSelectByPkRowWork ¶
func NewSelectByPkRowWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
func NewSelectByPkTxnWork ¶
func NewSelectByPkTxnWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
func NewSelectByUkRowWork ¶
func NewSelectByUkRowWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
func NewSelectByUkTxnWork ¶
func NewSelectByUkTxnWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
func NewUpdateRowWork ¶
func NewUpdateRowWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
func NewUpdateTxnWork ¶
func NewUpdateTxnWork(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
type CompositeWorkFactory ¶
type CompositeWorkFactory func(id int, rp *RunParams, recRange *intgen.Range) CompositeWork
type DeleteRowWork ¶
type DeleteRowWork struct {
// contains filtered or unexported fields
}
DeleteRowWork is a CompositeWork that deletes one row each time DoNext is called
Since the same record cannot be deleted twice, the DeleteRowWork takes a slice of row indexes which has the indexes of the rows (as per the DataGen) that this instance should delete. The creator of DeleteRowWork must ensure that it is giving mutually exclusive sets of row indexes to the different DeleteRowWork instances.
This class is Thread Safe. DoNext can be invoked from multiple threads
func (*DeleteRowWork) DoNext ¶
func (w *DeleteRowWork) DoNext() (bool, error)
DoNext deletes a single record, directly without transactions Returns true as long as there are more rows to be deleteed Returns false (indicating done) once delete has been attempted for all the rows that this DeleteRowWork has been assigned
type DeleteTxnWork ¶
type DeleteTxnWork struct {
// contains filtered or unexported fields
}
DeleteTxnWork is a CompositeWork that deletes one botch of rows using a transaction each time DoNext is called
Since the same record cannot be deleteed twice, the DeleteRowWork takes a slice of row indexes which has the indexes of the rows (as per the DataGen) that this instance should delete. The creator of DeleteRowWork must ensure that it is giving mutually exclusive sets of row indexes to the different DeleteRowWork instances.
This class is Thread Safe. DoNext can be invoked from multiple threads
func (*DeleteTxnWork) DoNext ¶
func (w *DeleteTxnWork) DoNext() (bool, error)
DoNext deletes a batch of records with transaction Returns true as long as there are more rows to be deleted Returns false (indicating done) once delete has been attempted for all the rows that this DeleteRowWork has been assigned
type InsertRowWork ¶
type InsertRowWork struct {
// contains filtered or unexported fields
}
InsertRowWork is a CompositeWork that inserts one row each time DoNext is called
Since the same record cannot be inserted twice, the InsertRowWork takes a slice of row indexes which has the indexes of the rows (as per the DataGen) that this instance should insert. The creator of InsertRowWork must ensure that it is giving mutually exclusive sets of row indexes to the different InsertRowWork instances.
This class is Thread Safe. DoNext can be invoked from multiple threads
func (*InsertRowWork) DoNext ¶
func (w *InsertRowWork) DoNext() (bool, error)
DoNext inserts a single record, directly without transactions Returns true as long as there are more rows to be inserted Returns false (indicating done) once insert has been attempted for all the rows that this InsertRowWork has been assigned
type InsertTxnWork ¶
type InsertTxnWork struct {
// contains filtered or unexported fields
}
InsertTxnWork is a CompositeWork that inserts one botch of rows using a transaction each time DoNext is called
Since the same record cannot be inserted twice, the InsertRowWork takes a slice of row indexes which has the indexes of the rows (as per the DataGen) that this instance should insert. The creator of InsertRowWork must ensure that it is giving mutually exclusive sets of row indexes to the different InsertRowWork instances.
This class is Thread Safe. DoNext can be invoked from multiple threads
func (*InsertTxnWork) DoNext ¶
func (w *InsertTxnWork) DoNext() (bool, error)
DoNext inserts a batch of records with transaction Returns true as long as there are more rows to be inserted Returns false (indicating done) once insert has been attempted for all the rows that this InsertRowWork has been assigned
type SelectByPkRowWork ¶
type SelectByPkRowWork struct {
// contains filtered or unexported fields
}
SelectByPkRowWork is a CompositeWork that selects one row by primary key each time DoNext is called This class is Thread Safe. DoNext can be invoked from multiple threads
func (*SelectByPkRowWork) DoNext ¶
func (w *SelectByPkRowWork) DoNext() (bool, error)
DoNext inserts a single record, directly without transactions This DoNext method never returns false (done) as records can be selected forever
type SelectByPkTxnWork ¶
type SelectByPkTxnWork struct {
// contains filtered or unexported fields
}
func (*SelectByPkTxnWork) DoNext ¶
func (w *SelectByPkTxnWork) DoNext() (bool, error)
DoNext selects a batch of records with transaction
type SelectByUkRowWork ¶
type SelectByUkRowWork struct {
// contains filtered or unexported fields
}
SelectByUkRowWork is a CompositeWork that selects one row by unique key each time DoNext is called This class is Thread Safe. DoNext can be invoked from multiple threads
func (*SelectByUkRowWork) DoNext ¶
func (w *SelectByUkRowWork) DoNext() (bool, error)
DoNext inserts a single record, directly without transactions This DoNext method never returns false (done) as records can be selected forever
type SelectByUkTxnWork ¶
type SelectByUkTxnWork struct {
// contains filtered or unexported fields
}
func (*SelectByUkTxnWork) DoNext ¶
func (w *SelectByUkTxnWork) DoNext() (bool, error)
DoNext selects a batch of records with transaction
type UpdateRowWork ¶
type UpdateRowWork struct {
// contains filtered or unexported fields
}
UpdateRowWork is a CompositeWork that updates one row each time DoNext is called This class is Thread Safe. DoNext can be invoked from multiple threads
func (*UpdateRowWork) DoNext ¶
func (w *UpdateRowWork) DoNext() (bool, error)
DoNext updates a single record, directly without transactions This DoNext method never returns false (done) as records can be updated forever
type UpdateTxnWork ¶
type UpdateTxnWork struct {
// contains filtered or unexported fields
}
func (*UpdateTxnWork) DoNext ¶
func (w *UpdateTxnWork) DoNext() (bool, error)
DoNext updates a batch of records with transaction This DoNext method never returns false (done) as records can be updated forever
type WorkAllocationStrategy ¶
type WorkAllocationStrategy int
const ( Partitioned WorkAllocationStrategy = iota )
type WorkerResult ¶ added in v0.2.0
type Workload ¶
type Workload struct {
// contains filtered or unexported fields
}
func NewDeleteRowWorkload ¶
func NewDeleteTxnWorkload ¶
func NewInsertRowWorkload ¶
func NewInsertTxnWorkload ¶
func NewUpdateRowWorkload ¶
func NewUpdateTxnWorkload ¶
func NewWorkload ¶
func (*Workload) CreateWorkerWithWork ¶
func (wl *Workload) CreateWorkerWithWork(work CompositeWork)