sim

package
v1.0.7-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSchema added in v1.0.1

func GetSchema(c *mongo.Collection, verbose bool) (string, error)

GetSchema returns a masked first doc of a collection

Types

type Frequency added in v1.0.1

type Frequency struct {
	// contains filtered or unexported fields
}

Frequency stores wait time

type Runner

type Runner struct {
	Logger  *gox.Logger         `bson:"keyhole"`
	Metrics map[string][]bson.M `bson:"metrics"`
	Results []string            `bson:"results"`
	// contains filtered or unexported fields
}

Runner -

func NewRunner

func NewRunner(connString connstring.ConnString) (*Runner, error)

NewRunner - Constructor

func (*Runner) Cleanup

func (rn *Runner) Cleanup() error

Cleanup drops the temp database

func (*Runner) CollectAllStatus added in v1.0.1

func (rn *Runner) CollectAllStatus() error

CollectAllStatus collects all server stats

func (*Runner) PopulateData added in v1.0.1

func (rn *Runner) PopulateData() error

PopulateData - Insert docs to evaluate performance/bandwidth

{
	favorites: {
		sports: []
		cities: []
	}
	favoriteSports: []
	favoriteSports1
	favoriteSports2
	favoriteSports3
}

func (*Runner) SetAutoMode added in v1.0.1

func (rn *Runner) SetAutoMode(auto bool)

SetAutoMode set transaction per second

func (*Runner) SetCollection added in v1.0.1

func (rn *Runner) SetCollection(collectionName string)

SetCollection set collection name

func (*Runner) SetDropFirstMode

func (rn *Runner) SetDropFirstMode(mode bool)

SetDropFirstMode -

func (*Runner) SetDuration added in v1.0.4

func (rn *Runner) SetDuration(duration int)

SetDuration sets simulation/load test duration

func (*Runner) SetNumberConnections

func (rn *Runner) SetNumberConnections(num int)

SetNumberConnections -

func (*Runner) SetPeekingMode added in v1.0.1

func (rn *Runner) SetPeekingMode(mode bool)

SetPeekingMode -

func (*Runner) SetSimOnlyMode

func (rn *Runner) SetSimOnlyMode(mode bool)

SetSimOnlyMode -

func (*Runner) SetTPS

func (rn *Runner) SetTPS(tps int)

SetTPS set transaction per second

func (*Runner) SetTemplateFilename

func (rn *Runner) SetTemplateFilename(filename string)

SetTemplateFilename -

func (*Runner) SetTransactionTemplate added in v1.0.4

func (rn *Runner) SetTransactionTemplate(filename string)

SetTransactionTemplate sets transaction template file

func (*Runner) SetVerbose

func (rn *Runner) SetVerbose(verbose bool)

SetVerbose sets verbose mode

func (*Runner) Simulate

func (rn *Runner) Simulate(duration int, transactions []Transaction, thread int) error

Simulate simulates CRUD for load tests

func (*Runner) Start

func (rn *Runner) Start() error

Start process requests

type ServerStats added in v1.0.1

type ServerStats struct {
	// contains filtered or unexported fields
}

ServerStats stores server stats struct

func NewServerStats added in v1.0.1

func NewServerStats(uri string, channel chan string) *ServerStats

NewServerStats gets server status

func (*ServerStats) SetPeekingMode added in v1.0.1

func (st *ServerStats) SetPeekingMode(peek bool)

SetPeekingMode sets peeking mode

func (*ServerStats) SetVerbose added in v1.0.1

func (st *ServerStats) SetVerbose(verbose bool)

SetVerbose sets verbose

type Transaction

type Transaction struct {
	C      string   `json:"c"`
	Filter bson.M   `json:"filter"`
	Op     bson.M   `json:"op"`
	Pipe   []bson.M `json:"pipe"`
}

Transaction -

type TransactionDoc

type TransactionDoc struct {
	Transactions []Transaction `json:"transactions" bson:"transactions"`
	Indexes      []bson.M      `json:"indexes" bson:"indexes"`
}

TransactionDoc -

func GetTransactions

func GetTransactions(filename string) TransactionDoc

GetTransactions -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL