line

package
v0.0.0-...-d67406e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

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 DefaultKeyMap() map[string]string

func DeprecatedKeyMap

func DeprecatedKeyMap() map[string]string

func LongKeyMap

func LongKeyMap() map[string]string

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

type StatLine struct {
	Fields  map[string]string
	Error   error
	Printed bool
}

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

type StatLines

type StatLines []*StatLine

func (StatLines) Len

func (slice StatLines) Len() int

func (StatLines) Less

func (slice StatLines) Less(i, j int) bool

func (StatLines) Swap

func (slice StatLines) Swap(i, j int)

Jump to

Keyboard shortcuts

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