Documentation ¶
Index ¶
- Variables
- func GetSchemaFromCollection(client *mongo.Client, dbName string, collection string) (string, error)
- func PopulateData(uri string, sslCAFile string, sslPEMKeyFile string) error
- func PrintAllStats(docs []mdb.ServerStatusDoc, span int) string
- type BuildInfo
- type CPUMetrics
- type DiagnosticData
- type DiagnosticDoc
- type DiskMetrics
- type Feeder
- func (f *Feeder) SeedAllDemoData(client *mongo.Client)
- func (f *Feeder) SeedCars(client *mongo.Client)
- func (f *Feeder) SeedData(client *mongo.Client) error
- func (f *Feeder) SeedFavorites(client *mongo.Client)
- 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) SetShowProgress(showProgress bool)
- func (f *Feeder) SetTotal(total int)
- type HostInfo
- type Model
- type OSDoc
- type Robot
- type Runner
- func (rn *Runner) Cleanup() error
- func (rn *Runner) CollectDBStats(client *mongo.Client, channel chan string, dbName string, uri string)
- func (rn *Runner) CollectServerStatus(uri string, channel chan string)
- func (rn *Runner) CreateIndexes(docs []bson.M) error
- func (rn *Runner) PrintServerStatus(uri string, span int) (string, error)
- func (rn *Runner) ReplSetGetStatus(uri string, channel chan string)
- func (rn *Runner) SetDropFirstMode(mode bool)
- func (rn *Runner) SetMonitorMode(mode bool)
- func (rn *Runner) SetNumberConnections(num int)
- func (rn *Runner) SetPeekMode(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)
- func (rn *Runner) Start() error
- type ServerInfoDoc
- type SystemDoc
- type SystemMetricsDoc
- type Task
- type Transaction
- type TransactionDoc
Constants ¶
This section is empty.
Variables ¶
var CollectionName = "examples"
CollectionName -
var SimDBName = fmt.Sprintf("_KEYHOLE_%X", 1024+1024*rand.Intn(1024))
SimDBName - db name for simulation
Functions ¶
func GetSchemaFromCollection ¶
func GetSchemaFromCollection(client *mongo.Client, dbName string, collection string) (string, error)
GetSchemaFromCollection returns a masked first doc of a collection
func PopulateData ¶
PopulateData - Insert docs to evaluate performance/bandwidth
{ favorites: { sports: [] cities: [] } favoriteSports: [] favoriteSports1 favoriteSports2 favoriteSports3 }
func PrintAllStats ¶
func PrintAllStats(docs []mdb.ServerStatusDoc, span int) string
PrintAllStats print all stats
Types ¶
type BuildInfo ¶
type BuildInfo struct {
Version string `json:"version" bson:"version"`
}
BuildInfo -
type CPUMetrics ¶
type CPUMetrics struct { IdleMS int64 `json:"idle_ms" bson:"idle_ms"` IOWaitMS int64 `json:"iowait_ms" bson:"iowait_ms"` NiceMS int64 `json:"nice_ms" bson:"nice_ms"` SoftirqMS int64 `json:"softirq_ms" bson:"softirq_ms"` StealMS int64 `json:"steal_ms" bson:"steal_ms"` SystemMS int64 `json:"system_ms" bson:"system_ms"` UserMS int64 `json:"user_ms" bson:"user_ms"` TotalMS int64 }
CPUMetrics -
type DiagnosticData ¶
type DiagnosticData struct { ServerInfo interface{} ServerStatusList []mdb.ServerStatusDoc ReplSetStatusList []mdb.ReplSetStatusDoc SystemMetricsList []SystemMetricsDoc // contains filtered or unexported fields }
DiagnosticData -
func (*DiagnosticData) DecodeDiagnosticData ¶ added in v1.1.1
func (d *DiagnosticData) DecodeDiagnosticData(filenames []string) error
DecodeDiagnosticData decodes FTDC data files
func (*DiagnosticData) PrintDiagnosticData ¶
func (d *DiagnosticData) PrintDiagnosticData(filenames []string) (string, error)
PrintDiagnosticData prints diagnostic data of MongoD
type DiagnosticDoc ¶
type DiagnosticDoc struct { Start time.Time `json:"start" bson:"start"` ServerStatus mdb.ServerStatusDoc `json:"serverStatus" bson:"serverStatus"` ReplSetGetStatus mdb.ReplSetStatusDoc `json:"replSetGetStatus" bson:"replSetGetStatus"` SystemMetrics SystemMetricsDoc `json:"systemMetrics" bson:"systemMetrics"` End time.Time `json:"end" bson:"end"` }
DiagnosticDoc -
type DiskMetrics ¶
type DiskMetrics struct { ReadTimeMS int64 `json:"read_time_ms" bson:"read_time_ms"` WriteTimeMS int64 `json:"write_time_ms" bson:"write_time_ms"` IO int64 IOQueuedMS int64 `json:"io_queued_ms" bson:"io_queued_ms"` IOTimeMS int64 `json:"io_time_ms" bson:"io_time_ms"` Reads int64 `json:"reads" bson:"reads"` Writes int64 `json:"writes" bson:"writes"` }
DiskMetrics -
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) SetShowProgress ¶
SetShowProgress set showProgress
type HostInfo ¶
type HostInfo struct { OS OSDoc `json:"os" bson:"os"` System SystemDoc `json:"system" bson:"system"` }
HostInfo -
type OSDoc ¶
type OSDoc struct { Name string `json:"name" bson:"name"` Type string `json:"type" bson:"type"` Version string `json:"version" bson:"version"` }
OSDoc -
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 (*Runner) CollectDBStats ¶
func (rn *Runner) CollectDBStats(client *mongo.Client, channel chan string, dbName string, uri string)
CollectDBStats collects dbStats every 10 seconds
func (*Runner) CollectServerStatus ¶
CollectServerStatus collects db.serverStatus() every minute
func (*Runner) CreateIndexes ¶
CreateIndexes creates indexes
func (*Runner) PrintServerStatus ¶
PrintServerStatus prints serverStatusDocs summary for the duration
func (*Runner) ReplSetGetStatus ¶
ReplSetGetStatus collects {replSetGetStatus: 1} every minute
func (*Runner) SetNumberConnections ¶
SetNumberConnections -
func (*Runner) SetSimulationDuration ¶
SetSimulationDuration -
func (*Runner) SetTemplateFilename ¶
SetTemplateFilename -
func (*Runner) SetTransactionTemplateFilename ¶
SetTransactionTemplateFilename -
type ServerInfoDoc ¶
type ServerInfoDoc struct { HostInfo HostInfo `json:"hostInfo" bson:"hostInfo"` BuildInfo BuildInfo `json:"buildInfo" bson:"buildInfo"` }
ServerInfoDoc -
type SystemDoc ¶
type SystemDoc struct { CPUArch string `json:"cpuArch" bson:"cpuArch"` Hostname string `json:"hostname" bson:"hostname"` NumCores int `json:"numCores" bson:"numCores"` MemSizeMB int `json:"memSizeMB" bson:"memSizeMB"` }
SystemDoc -
type SystemMetricsDoc ¶
type SystemMetricsDoc struct { Start time.Time `json:"start" bson:"start"` CPU CPUMetrics `json:"cpu" bson:"cpu"` Disks map[string]DiskMetrics `json:"disks" bson:"disks"` }
SystemMetricsDoc -
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 -