Documentation
¶
Overview ¶
Package mongotop provides a method to track the amount of time a MongoDB instance spends reading and writing data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Usage = `` /* 254-byte string literal not displayed */
Functions ¶
This section is empty.
Types ¶
type FormattableDiff ¶
type FormattableDiff interface {
// Generate a JSON representation of the diff
JSON() string
// Generate a table-like representation which can be printed to a terminal
Grid() string
}
FormattableDiff represents a diff of two samples taken by mongotop, which can be printed to output in various formats.
type LockStats ¶
type LockStats struct {
AcquireCount *ReadWriteLockTimes `bson:"acquireCount"`
TimeLockedMicros ReadWriteLockTimes `bson:"timeLockedMicros"`
TimeAcquiringMicros ReadWriteLockTimes `bson:"timeAcquiringMicros"`
}
LockStats contains information on time spent acquiring and holding a lock.
type MongoTop ¶
type MongoTop struct {
// Generic mongo tool options
Options *options.ToolOptions
// Mongotop-specific output options
OutputOptions *Output
// for connecting to the db
SessionProvider *db.SessionProvider
// Length of time to sleep between each polling.
Sleeptime time.Duration
// contains filtered or unexported fields
}
MongoTop is a container for the user-specified options and internal state used for running mongotop.
type NSTopInfo ¶
type NSTopInfo struct {
Total TopField `bson:"total" json:"total"`
Read TopField `bson:"readLock" json:"read"`
Write TopField `bson:"writeLock" json:"write"`
}
NSTopInfo holds information about a single namespace.
type Output ¶
type Output struct {
Locks bool `long:"locks" description:"report on use of per-database locks"`
RowCount int `long:"rowcount" value-name:"<count>" short:"n" description:"number of stats lines to print (0 for indefinite)"`
Json bool `long:"json" description:"format output as JSON"`
}
Output defines the set of options to use in displaying data from the server.
type ReadWriteLockTimes ¶
type ReadWriteLockTimes struct {
Read int64 `bson:"R"`
Write int64 `bson:"W"`
ReadLower int64 `bson:"r"`
WriteLower int64 `bson:"w"`
}
ReadWriteLockTimes contains read/write lock times on a database.
type ServerStatus ¶
ServerStatus represents the results of the "serverStatus" command.
func (ServerStatus) Diff ¶
func (ss ServerStatus) Diff(previous ServerStatus) ServerStatusDiff
Diff takes an older ServerStatus sample, and produces a ServerStatusDiff representing the deltas of each metric between the two samples.
type ServerStatusDiff ¶
type ServerStatusDiff struct {
// namespace -> lock times
Totals map[string]LockDelta `json:"totals"`
Time time.Time `json:"time"`
}
ServerStatusDiff contains a map of the lock time differences for each database.
func (ServerStatusDiff) Grid ¶
func (ssd ServerStatusDiff) Grid() string
Grid returns a tabular representation of the ServerStatusDiff.
func (ServerStatusDiff) JSON ¶
func (ssd ServerStatusDiff) JSON() string
JSON returns a JSON representation of the ServerStatusDiff.