Documentation ¶
Index ¶
- func GetSchema(c *mongo.Collection, verbose bool) (string, error)
- type Feeder
- func (f *Feeder) SeedAllDemoData(client *mongo.Client) error
- func (f *Feeder) SeedCars(client *mongo.Client) error
- func (f *Feeder) SeedData(client *mongo.Client) error
- func (f *Feeder) SeedFavorites(client *mongo.Client) error
- func (f *Feeder) SetCollection(collection string)
- func (f *Feeder) SetDatabase(database string)
- func (f *Feeder) SetFile(file string)
- func (f *Feeder) SetIsDrop(isDrop bool)
- func (f *Feeder) SetNumberConnections(conns int)
- func (f *Feeder) SetShowProgress(showProgress bool)
- func (f *Feeder) SetTotal(total int)
- type Frequency
- type Model
- type Robot
- type Runner
- func (rn *Runner) Cleanup() error
- func (rn *Runner) CollectAllStatus() error
- func (rn *Runner) PopulateData() error
- func (rn *Runner) SetAutoMode(auto bool)
- func (rn *Runner) SetCollection(collectionName string)
- func (rn *Runner) SetDropFirstMode(mode bool)
- func (rn *Runner) SetNumberConnections(num int)
- func (rn *Runner) SetPeekingMode(mode bool)
- func (rn *Runner) SetSimOnlyMode(mode bool)
- func (rn *Runner) SetSimulationDuration(duration int)
- func (rn *Runner) SetTPS(tps int)
- func (rn *Runner) SetTemplateFilename(filename string)
- func (rn *Runner) SetTransactionTemplateFilename(filename string)
- func (rn *Runner) SetVerbose(verbose bool)
- func (rn *Runner) Simulate(duration int, transactions []Transaction, thread int) error
- func (rn *Runner) Start() error
- type ServerStats
- type Task
- type Transaction
- type TransactionDoc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Feeder ¶
type Feeder struct {
// contains filtered or unexported fields
}
Feeder seeds feeder
func (*Feeder) SeedAllDemoData ¶
SeedAllDemoData - seed data for demo
models: { "_id": string "name": string, "description": string "year": integer }
robots: { "_id": string "modelId": string "notes": string, "batteryPct": float, "tasks": [{"for": string, "minutesUsed": integer}] }
func (*Feeder) SeedFavorites ¶
SeedFavorites seeds demo data of collection favorites
func (*Feeder) SetCollection ¶
SetCollection set collection
func (*Feeder) SetNumberConnections ¶ added in v1.0.1
SetNumberConnections set conns
func (*Feeder) SetShowProgress ¶
SetShowProgress set showProgress
type Frequency ¶ added in v1.0.1
type Frequency struct {
// contains filtered or unexported fields
}
Frequency stores wait time
type Robot ¶
type Robot struct { ID string `json:"_id" bson:"_id"` ModelID string `json:"modelId,omitempty" bson:"modelId,omitempty"` Notes string `json:"notes" bson:"notes"` BatteryPct float32 `json:"batteryPct,omitempty" bson:"batteryPct,omitempty"` Tasks []Task `json:"tasks" bson:"tasks"` }
Robot -
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner -
func NewRunner ¶
func NewRunner(connString connstring.ConnString) (*Runner, error)
NewRunner - Constructor
func (*Runner) CollectAllStatus ¶ added in v1.0.1
CollectAllStatus collects all server stats
func (*Runner) PopulateData ¶ added in v1.0.1
PopulateData - Insert docs to evaluate performance/bandwidth
{ favorites: { sports: [] cities: [] } favoriteSports: [] favoriteSports1 favoriteSports2 favoriteSports3 }
func (*Runner) SetAutoMode ¶ added in v1.0.1
SetAutoMode set transaction per second
func (*Runner) SetCollection ¶ added in v1.0.1
SetCollection set collection name
func (*Runner) SetNumberConnections ¶
SetNumberConnections -
func (*Runner) SetPeekingMode ¶ added in v1.0.1
SetPeekingMode -
func (*Runner) SetSimulationDuration ¶
SetSimulationDuration -
func (*Runner) SetTemplateFilename ¶
SetTemplateFilename -
func (*Runner) SetTransactionTemplateFilename ¶
SetTransactionTemplateFilename -
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 Task ¶
type Task struct { For string `json:"for" bson:"for"` MinutesUsed int `json:"minutesUsed" bson:"minutesUsed"` }
Task - robot task
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 -