Documentation ¶
Index ¶
- func AnalyzeMongoLogs(loginfo *mdb.LogInfo, filenames []string, maobiURL string) error
- func CollectIndexStats(index *mdb.IndexStats, client *mongo.Client, maobiURL string) error
- func CompareClusters(cfg *Config) error
- func CompareMetadata(cfg *Config) error
- func DuplicateIndexesFromFile(index *mdb.IndexStats, client *mongo.Client, filename string, isDrop bool) error
- func Exec(filename string, signature string) error
- func GenerateMaobiReport(maobiURL string, data []byte, ofile string) error
- func GetClusterSummary(version string, client *mongo.Client) string
- func GetMongoClientFromPool(uri string) (*mongo.Client, error)
- func GetQualifiedDatabases(client *mongo.Client) ([]string, error)
- func GetQualifiedNamespaces(client *mongo.Client) ([]string, error)
- func GetQualifiedNamespacesByDB(client *mongo.Client, dbName string) ([]string, error)
- func GetValidatorTemplate() (*template.Template, error)
- func MonitorWiredTigerCache(version string, client *mongo.Client)
- func PrintCompareHelp()
- func PrintConnections(cfg *Config) error
- func PrintConnectionsFromFile(filename string) error
- func PrintConnectionsFromURI(uri string) error
- func Run(fullVersion string)
- func StartSimulation(runner *sim.Runner) error
- func Stringify(doc interface{}) string
- func WirteValidatorHTML(stats ComparatorStats) error
- type Comparator
- type ComparatorStats
- type Comparison
- type Config
- type ErrorMessage
- type Filter
- type IncludeDB
- type Logv2Network
- type Model
- type NamespaceStats
- type Robot
- type Seed
- func (f *Seed) SeedAllDemoData(client *mongo.Client) error
- func (f *Seed) SeedData(client *mongo.Client) error
- func (f *Seed) SeedFavorites(client *mongo.Client) error
- func (f *Seed) SeedTimeSeriesData(client *mongo.Client) error
- func (f *Seed) SeedTimeSeriesWeather(client *mongo.Client) error
- func (f *Seed) SeedVehicles(client *mongo.Client) error
- func (f *Seed) SetCollection(collection string)
- func (f *Seed) SetDatabase(database string)
- func (f *Seed) SetFile(file string)
- func (f *Seed) SetIsDrop(isDrop bool)
- func (f *Seed) SetNumberConnections(conns int)
- func (f *Seed) SetShowProgress(showProgress bool)
- func (f *Seed) SetTotal(total int)
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyzeMongoLogs ¶ added in v1.0.4
AnalyzeMongoLogs a helper function to analyze logs
func CollectIndexStats ¶ added in v1.0.4
CollectIndexStats collects all indexes stats
func CompareClusters ¶ added in v1.2.1
CompareClusters compares two clusters, source and target
func CompareMetadata ¶ added in v1.2.1
CompareMetadata compares two clusters' metadata
func DuplicateIndexesFromFile ¶ added in v1.0.4
func DuplicateIndexesFromFile(index *mdb.IndexStats, client *mongo.Client, filename string, isDrop bool) error
DuplicateIndexesFromFile duplicate indexes from definitions defined in a file
func GenerateMaobiReport ¶ added in v1.1.5
GenerateMaobiReport outputs an HTML from Maobi
func GetClusterSummary ¶ added in v1.0.4
GetClusterSummary returns MongoDB cluster summary
func GetMongoClientFromPool ¶ added in v1.2.1
GetMongoClientFromPool returns a mongo client by an endpoint
func GetQualifiedDatabases ¶ added in v1.2.1
GetQualifiedDatabases returns a list of qualified database names
func GetQualifiedNamespaces ¶ added in v1.2.1
GetQualifiedNamespaces returns a list of qualified namespace names
func GetQualifiedNamespacesByDB ¶ added in v1.2.1
GetQualifiedNamespacesByDB returns a list of qualified namespace names
func GetValidatorTemplate ¶ added in v1.2.1
GetValidatorTemplate returns HTML of -compare
func MonitorWiredTigerCache ¶ added in v1.0.4
MonitorWiredTigerCache monitor wiredTiger cache
func PrintCompareHelp ¶ added in v1.2.1
func PrintCompareHelp()
PrintCompareHelp prints help message
func PrintConnections ¶ added in v1.2.1
PrintConnections print all connection info
func PrintConnectionsFromFile ¶ added in v1.2.1
PrintConnectionsFromFile print all connection info from a log file
func PrintConnectionsFromURI ¶ added in v1.2.1
PrintConnectionsFromURI print all connection info from all mongod
func StartSimulation ¶ added in v1.0.4
StartSimulation kicks off simulation
func Stringify ¶ added in v1.2.1
func Stringify(doc interface{}) string
Stringify returns JSON string
func WirteValidatorHTML ¶ added in v1.2.1
func WirteValidatorHTML(stats ComparatorStats) error
WirteValidatorHTML outputs validators to a HTML file
Types ¶
type Comparator ¶ added in v1.2.1
type Comparator struct {
// contains filtered or unexported fields
}
Comparator stores validation info
func NewComparator ¶ added in v1.2.1
func NewComparator(source string, target string) (*Comparator, error)
NewComparator returns Comparator
type ComparatorStats ¶ added in v1.2.1
type ComparatorStats struct { Messages []ErrorMessage Status []NamespaceStats }
ComparatorStats stores data for HTML
type Comparison ¶
type Comparison struct { Logger *gox.Logger `bson:"keyhole"` SourceStats *mdb.ClusterStats `bson:"source"` TargetStats *mdb.ClusterStats `bson:"target"` // contains filtered or unexported fields }
Comparison contains parameters of comparison parameters
func NewComparison ¶
func NewComparison(keyholeVersion string) *Comparison
NewComparison returns *Comparison
func (*Comparison) Compare ¶ added in v1.0.6
func (p *Comparison) Compare(source string, target string) error
Compare executes compare commands
func (*Comparison) OutputBSON ¶
func (p *Comparison) OutputBSON() error
OutputBSON writes bson data to a file
func (*Comparison) SetNoColor ¶
func (p *Comparison) SetNoColor(nocolor bool)
SetNoColor set nocolor flag
func (*Comparison) SetVerbose ¶
func (p *Comparison) SetVerbose(verbose bool)
SetVerbose sets verbose
type Config ¶ added in v1.2.1
type Config struct { Action string `bson:"action,omitempty"` Filename string `bson:"filename,omitempty"` NoColor bool `bson:"no_color,omitempty"` Signature string `bson:"signature,omitempty"` URI string `bson:"uri,omitempty"` Verbose bool `bson:"verbose,omitempty"` IsDeepCompare bool `bson:"deep_compare,omitempty"` Filters []Filter `bson:"filters,omitempty"` SampleSize int `bson:"sample_size,omitempty"` SourceURI string `bson:"source_uri,omitempty"` TargetURI string `bson:"target_uri,omitempty"` }
Config stores keyhole configuration
type ErrorMessage ¶ added in v1.2.1
ErrorMessage keeps error message and info
type Filter ¶ added in v1.2.1
type Filter struct { NS string `bson:"ns"` Query bson.D `bson:"query"` TargetNS string `bson:"target_ns,omitempty"` }
Filter holds query filter of a namespace
type IncludeDB ¶ added in v1.1.7
type IncludeDB []string
IncludeDB stores excluded QueryFilter
type Logv2Network ¶ added in v1.2.1
type Logv2Network struct { Attributes struct { ConnectionCount int `json:"connectionCount" bson:"connectionCount"` ConnectionID int `json:"connectionId" bson:"connectionId"` Remote string `json:"remote" bson:"remote"` } `json:"attr" bson:"attr"` Component string `json:"c" bson:"c"` Context string `json:"ctx" bson:"ctx"` ID int `json:"id" bson:"id"` Message string `json:"msg" bson:"msg"` Timestamp map[string]string `json:"t" bson:"t"` }
Logv2Network stores logv2 network info
type NamespaceStats ¶ added in v1.2.1
type NamespaceStats struct { NS string `json:"ns" bson:"ns"` Query bson.D `json:"query" bson:"query"` SourceCount int64 `json:"source_counts" bson:"source_counts"` SourceIndexes int64 `json:"source_indexes" bson:"source_indexes"` TargetCount int64 `json:"target_counts" bson:"target_counts"` TargetIndexes int64 `json:"target_indexes" bson:"target_indexes"` }
NamespaceStats stores migration counts
type Robot ¶ added in v1.0.4
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 Seed ¶ added in v1.0.4
type Seed struct {
// contains filtered or unexported fields
}
Seed seeds feeder
func (*Seed) SeedAllDemoData ¶ added in v1.0.4
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 (*Seed) SeedFavorites ¶ added in v1.0.4
SeedFavorites seeds demo data of collection favorites
func (*Seed) SeedTimeSeriesData ¶ added in v1.1.5
SeedTimeSeriesData seeds demo data of timeseries
func (*Seed) SeedTimeSeriesWeather ¶ added in v1.1.5
SeedTimeSeriesWeather seeds demo data of timeseries
func (*Seed) SeedVehicles ¶ added in v1.0.4
SeedVehicles seeds vehicles collection
func (*Seed) SetCollection ¶ added in v1.0.4
SetCollection set collection
func (*Seed) SetDatabase ¶ added in v1.0.4
SetDatabase set database
func (*Seed) SetNumberConnections ¶ added in v1.0.4
SetNumberConnections set conns
func (*Seed) SetShowProgress ¶ added in v1.0.4
SetShowProgress set showProgress