Documentation ¶
Index ¶
Constants ¶
View Source
const ( FlagAlways = 1 << iota // always activate the column FlagHosts // only active if we may have multiple hosts FlagDiscover // only active when mongostat is in discover mode FlagRepl // only active if one of the nodes being monitored is in a replset FlagLocks // only active if node is capable of calculating lock info FlagAll // only active if mongostat was run with --all option FlagMMAP // only active if node has mmap-specific fields FlagWT // only active if node has wiredtiger-specific fields )
Flags to determine cases when to activate/deactivate columns for output.
Variables ¶
View Source
var ( StatHeaders = map[string]StatHeader{ "host": {status.ReadHost}, "storage_engine": {status.ReadStorageEngine}, "insert": {status.ReadInsert}, "query": {status.ReadQuery}, "update": {status.ReadUpdate}, "delete": {status.ReadDelete}, "getmore": {status.ReadGetMore}, "command": {status.ReadCommand}, "dirty": {status.ReadDirty}, "used": {status.ReadUsed}, "flushes": {status.ReadFlushes}, "mapped": {status.ReadMapped}, "vsize": {status.ReadVSize}, "res": {status.ReadRes}, "nonmapped": {status.ReadNonMapped}, "faults": {status.ReadFaults}, "lrw": {status.ReadLRW}, "lrwt": {status.ReadLRWT}, "locked_db": {status.ReadLockedDB}, "qrw": {status.ReadQRW}, "arw": {status.ReadARW}, "net_in": {status.ReadNetIn}, "net_out": {status.ReadNetOut}, "conn": {status.ReadConn}, "set": {status.ReadSet}, "repl": {status.ReadRepl}, "time": {status.ReadTime}, } CondHeaders = []struct { Key string Flag int }{ {"host", FlagHosts}, {"insert", FlagAlways}, {"query", FlagAlways}, {"update", FlagAlways}, {"delete", FlagAlways}, {"getmore", FlagAlways}, {"command", FlagAlways}, {"dirty", FlagWT}, {"used", FlagWT}, {"flushes", FlagAlways}, {"mapped", FlagMMAP}, {"vsize", FlagAlways}, {"res", FlagAlways}, {"nonmapped", FlagMMAP | FlagAll}, {"faults", FlagMMAP}, {"lrw", FlagMMAP | FlagAll}, {"lrwt", FlagMMAP | FlagAll}, {"locked_db", FlagLocks}, {"qrw", FlagAlways}, {"arw", FlagAlways}, {"net_in", FlagAlways}, {"net_out", FlagAlways}, {"conn", FlagAlways}, {"set", FlagRepl}, {"repl", FlagRepl}, {"time", FlagAlways}, } )
StatHeaders are the complete set of data metrics supported by mongostat.
Functions ¶
func DefaultKeyMap ¶
func DeprecatedKeyMap ¶
func LongKeyMap ¶
Types ¶
type StatHeader ¶
type StatHeader struct { // ReadField produces a particular field according to the StatHeader instance. // Some fields are based on a diff, so both latest ServerStatuses are taken. ReadField func(c *status.ReaderConfig, newStat, oldStat *status.ServerStatus) string }
StatHeader describes a single column for mongostat's terminal output, its formatting, and in which modes it should be displayed.
type StatLine ¶
StatLine is a wrapper for all metrics reported by mongostat for monitored hosts
func NewStatLine ¶
func NewStatLine(oldStat, newStat *status.ServerStatus, headerKeys []string, c *status.ReaderConfig) *StatLine
NewStatLine constructs a StatLine object from two ServerStatus objects
Click to show internal directories.
Click to hide internal directories.