Documentation
¶
Index ¶
- type LocalTXGen
- func (gen *LocalTXGen) ApplyEvents(_ context.Context, evts *stdtypes.EventList) error
- func (gen *LocalTXGen) ApplyTXs(txs []*trantorpbtypes.Transaction) error
- func (gen *LocalTXGen) Checkpoint(_ *checkpoint.StableCheckpoint) error
- func (gen *LocalTXGen) EventsOut() <-chan *stdtypes.EventList
- func (gen *LocalTXGen) ImplementsModule()
- func (gen *LocalTXGen) RestoreState(_ *checkpoint.StableCheckpoint) error
- func (gen *LocalTXGen) Snapshot() ([]byte, error)
- func (gen *LocalTXGen) Start()
- func (gen *LocalTXGen) Stop()
- func (gen *LocalTXGen) TrackStats(tracker stats.Tracker)
- type ModuleConfig
- type ModuleParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalTXGen ¶
type LocalTXGen struct {
// contains filtered or unexported fields
}
func New ¶
func New(moduleConfig ModuleConfig, params ModuleParams) *LocalTXGen
func (*LocalTXGen) ApplyEvents ¶
ApplyEvents returns an error on any event it receives, except fot the Init event, which it silently ignores.
func (*LocalTXGen) ApplyTXs ¶
func (gen *LocalTXGen) ApplyTXs(txs []*trantorpbtypes.Transaction) error
func (*LocalTXGen) Checkpoint ¶
func (gen *LocalTXGen) Checkpoint(_ *checkpoint.StableCheckpoint) error
func (*LocalTXGen) EventsOut ¶
func (gen *LocalTXGen) EventsOut() <-chan *stdtypes.EventList
EventsOut returns the channel to which LocalTXGen writes all output events (in this case just NewRequests events).
func (*LocalTXGen) ImplementsModule ¶
func (gen *LocalTXGen) ImplementsModule()
func (*LocalTXGen) RestoreState ¶
func (gen *LocalTXGen) RestoreState(_ *checkpoint.StableCheckpoint) error
func (*LocalTXGen) Snapshot ¶
func (gen *LocalTXGen) Snapshot() ([]byte, error)
func (*LocalTXGen) Start ¶
func (gen *LocalTXGen) Start()
Start starts generating transactions at the defined rate.
func (*LocalTXGen) Stop ¶
func (gen *LocalTXGen) Stop()
Stop stops the transaction generation and waits until the internal transaction generation thread stops. A call to Stop without a prior call to Start blocks until Start is called (immediately receiving the stop signal). Note that, in such a case, the calls to Start and Stop will inevitably be concurrent, and some transactions might be submitted before Stop returns. After Stop returns, however, no transactions will be output.
func (*LocalTXGen) TrackStats ¶
func (gen *LocalTXGen) TrackStats(tracker stats.Tracker)
type ModuleConfig ¶
func DefaultModuleConfig ¶
func DefaultModuleConfig() ModuleConfig
type ModuleParams ¶
type ModuleParams struct {
ClientID tt.ClientID
PayloadSize int `json:",string"`
NumClients int `json:",string"`
}
func DefaultModuleParams ¶
func DefaultModuleParams(clientID tt.ClientID) ModuleParams