proto

package
v3.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: GPL-2.0 Imports: 8 Imported by: 0

README

#Percona Toolkit for MongoDB structures

This is a collection of structures used to gather information from MongoDB config and stats.

Documentation

Index

Constants

View Source
const (
	REPLICA_SET_MEMBER_STARTUP = iota
	REPLICA_SET_MEMBER_PRIMARY
	REPLICA_SET_MEMBER_SECONDARY
	REPLICA_SET_MEMBER_RECOVERING
	REPLICA_SET_MEMBER_STARTUP2
	REPLICA_SET_MEMBER_UNKNOWN
	REPLICA_SET_MEMBER_ARBITER
	REPLICA_SET_MEMBER_DOWN
	REPLICA_SET_MEMBER_ROOLBACK
	REPLICA_SET_MEMBER_REMOVED
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquireCount

type AcquireCount struct {
	Rr float64 `bson:"r"`
	Ww float64 `bson:"w"`
	R  float64 `bson:"R"`
	W  float64 `bson:"W"`
}

type AcquiredLocks

type AcquiredLocks struct {
	AcquireCount        *AcquireCount `bson:"acquireCount"`
	AcquireWaitCount    float64       `bson:"acquireWaitCount.W"`
	TimeAcquiringMicros float64       `bson:"timeAcquiringMicros.W"`
}

type ActiveClients

type ActiveClients struct {
	Readers int64 `bson:"readers"`
	Total   int64 `bson:"total"`
	Writers int64 `bson:"writers"`
}

type Asserts

type Asserts struct {
	User      float64 `bson:"user"`
	Warning   float64 `bson:"warning"`
	Msg       float64 `bson:"msg"`
	Regular   float64 `bson:"regular"`
	Rollovers float64 `bson:"rollovers"`
}

type BackgroundFlushing

type BackgroundFlushing struct {
	AverageMs    float64 `bson:"average_ms"`
	Flushes      float64 `bson:"flushes"`
	LastFinished string  `bson:"last_finished"`
	LastMs       float64 `bson:"last_ms"`
	TotalMs      float64 `bson:"total_ms"`
}

type BalancerStats

type BalancerStats struct {
	Success  int64
	Failed   int64
	Splits   int64
	Drops    int64
	Settings map[string]interface{}
}

type BsonD

type BsonD bson.D

func (BsonD) Len

func (d BsonD) Len() int

func (BsonD) Map

func (d BsonD) Map() (m bson.M)

Map returns a map out of the ordered element name/value pairs in d.

func (BsonD) MarshalJSON

func (d BsonD) MarshalJSON() ([]byte, error)

func (*BsonD) UnmarshalJSON

func (d *BsonD) UnmarshalJSON(data []byte) error

type BuildInfo

type BuildInfo struct {
	Version        string
	VersionArray   []int32
	GitVersion     string
	OpenSSLVersion string
	SysInfo        string
	Bits           int32
	Debug          bool
	MaxObjectSize  int64
}

BuildInfo Struct to store results of calling session.BuildInfo()

type CacheStats

type CacheStats struct {
	TrackedDirtyBytes  int64 `bson:"tracked dirty bytes in the cache"`
	CurrentCachedBytes int64 `bson:"bytes currently in the cache"`
	MaxBytesConfigured int64 `bson:"maximum bytes configured"`
}

CacheStats stores cache statistics for WiredTiger.

type ChunksByCollection

type ChunksByCollection struct {
	ID    string `bson:"_id"` // Namespace
	Count int    `bson:"count"`
}

type ClientStats

type ClientStats struct {
	Total   int64 `bson:"total"`
	Readers int64 `bson:"readers"`
	Writers int64 `bson:"writers"`
}

ClientStats stores the number of active read/write operations.

type CloStorage

type CloStorage struct {
	DbPath string `bson:"dbPath"`
	Engine string `bson:"engine"`
}

type CloSystemLog

type CloSystemLog struct {
	Destination string `bson:"destination"`
	Path        string `bson:"path"`
}

type CollStats

type CollStats struct {
	Sharded           bool   `json:"sharded"`
	PaddingFactorNote string `json:"paddingFactorNote"`
	UserFlags         int64  `json:"userFlags"`
	Capped            bool   `json:"capped"`
	Ns                string `json:"ns"`
	Count             int64  `json:"count"`
	NumExtents        int64  `json:"numExtents"`
	Size              int64  `json:"size"`
	StorageSize       int64  `json:"storageSize"`
	TotalIndexSize    int64  `json:"totalIndexSize"`
	IndexSizes        struct {
		ID       int `json:"_id_"`
		IDHashed int `json:"_id_hashed"`
	} `json:"indexSizes"`
	AvgObjSize int64                `json:"avgObjSize"`
	Nindexes   int64                `json:"nindexes"`
	Nchunks    int64                `json:"nchunks"`
	Shards     map[string]ShardStas `json:"shards"`
	Ok         int64                `json:"ok"`
}

type CollectionEntry

type CollectionEntry struct {
	Name    string `bson:"name"`
	Type    string `bson:"type"`
	Options struct {
		Capped      bool  `bson:"capped"`
		Size        int64 `bson:"size"`
		AutoIndexID bool  `bson:"autoIndexId"`
	} `bson:"options"`
	Info struct {
		ReadOnly bool             `bson:"readOnly"`
		UUID     primitive.Binary `bson:"uuid"`
	} `bson:"info"`
}

CollectionEntry represents an entry for ListCollections

type CommandLineOptions

type CommandLineOptions struct {
	Argv     []string `bson:"argv"`
	Ok       float64  `bson:"ok"`
	Parsed   Parsed   `bson:"parsed"`
	Security Security `bson:"security"`
}

type CommandStats

type CommandStats struct {
	Failed float64 `bson:"failed"`
	Total  float64 `bson:"total"`
}

type ConcurrentTransStats

type ConcurrentTransStats struct {
	Out int64 `bson:"out"`
}

type ConcurrentTransactions

type ConcurrentTransactions struct {
	Write ConcurrentTransStats `bson:"write"`
	Read  ConcurrentTransStats `bson:"read"`
}

type ConnectionStats

type ConnectionStats struct {
	Current      int64 `bson:"current"`
	Available    int64 `bson:"available"`
	TotalCreated int64 `bson:"totalCreated"`
}

ConnectionStats stores information related to incoming database connections.

type Connections

type Connections struct {
	Available    float64 `bson:"available"`
	Current      float64 `bson:"current"`
	TotalCreated float64 `bson:"totalCreated"`
}

type CurrentOp

type CurrentOp struct {
	Info      string   `bson:"info"`
	Inprog    []Inprog `bson:"inprog"`
	FsyncLock float64  `bson:"fsyncLock"`
}

type CurrentOpLockStats

type CurrentOpLockStats struct {
	Global        LockInfo    `bson:"Global"`
	MMAPV1Journal interface{} `bson:"MMAPV1Journal"`
	Database      interface{} `bson:"Database"`
}

type CurrentQueue

type CurrentQueue struct {
	Writers int64 `bson:"writers"`
	Readers int64 `bson:"readers"`
	Total   int64 `bson:"total"`
}

type Cursor

type Cursor struct {
	NoTimeout float64 `bson:"open.noTimeout"`
	Pinned    float64 `bson:"open.pinned"`
	TimedOut  float64 `bson:"timedOut"`
	Total     float64 `bson:"open.total"`
}

type Cursors

type Cursors struct {
	ClientCursorsSize float64 `bson:"clientCursors_size"`
	Note              string  `bson:"note"`
	Pinned            float64 `bson:"pinned"`
	TimedOut          float64 `bson:"timedOut"`
	TotalNoTimeout    float64 `bson:"totalNoTimeout"`
	TotalOpen         float64 `bson:"totalOpen"`
}

type DBRecordStats

type DBRecordStats struct {
	AccessesNotInMemory       int64                     `bson:"accessesNotInMemory"`
	PageFaultExceptionsThrown int64                     `bson:"pageFaultExceptionsThrown"`
	DBRecordAccesses          map[string]RecordAccesses `bson:",inline"`
}

DBRecordStats stores data related to memory operations across databases.

type Database

type Database struct {
	Name       string `bson:"name"`
	SizeOnDisk int64  `bson:"sizeOnDisk"`
	Empty      bool   `bson:"empty"`
}

Database item plus struct to hold collections stats

type Databases

type Databases struct {
	Databases []Database `bson:"databases"`
}

Database struct for listDatabases command

type Document

type Document struct {
	Deleted  float64 `bson:"deleted"`
	Inserted float64 `bson:"inserted"`
	Returned float64 `bson:"returned"`
	Updated  float64 `bson:"updated"`
}

type Dur

type Dur struct {
	TimeMs             *TimeMs `bson:"timeMs"`
	WriteToDataFilesMB float64 `bson:"writeToDataFilesMB"`
	Commits            float64 `bson:"commits"`
	CommitsInWriteLock float64 `bson:"commitsInWriteLock"`
	Compression        float64 `bson:"compression"`
	EarlyCommits       float64 `bson:"earlyCommits"`
	JournaledMB        float64 `bson:"journaledMB"`
}

type DurStats

type DurStats struct {
	Commits            int64 `bson:"commits"`
	JournaledMB        int64 `bson:"journaledMB"`
	WriteToDataFilesMB int64 `bson:"writeToDataFilesMB"`
	Compression        int64 `bson:"compression"`
	CommitsInWriteLock int64 `bson:"commitsInWriteLock"`
	EarlyCommits       int64 `bson:"earlyCommits"`
	TimeMs             DurTiming
}

DurStats stores information related to journaling statistics.

type DurTiming

type DurTiming struct {
	Dt               int64 `bson:"dt"`
	PrepLogBuffer    int64 `bson:"prepLogBuffer"`
	WriteToJournal   int64 `bson:"writeToJournal"`
	WriteToDataFiles int64 `bson:"writeToDataFiles"`
	RemapPrivateView int64 `bson:"remapPrivateView"`
}

DurTiming stores information related to journaling.

type ExampleQuery

type ExampleQuery struct {
	Ns                 string `bson:"ns" json:"ns"`
	Op                 string `bson:"op" json:"op"`
	Query              bson.D `bson:"query,omitempty" json:"query,omitempty"`
	Command            bson.D `bson:"command,omitempty" json:"command,omitempty"`
	OriginatingCommand bson.D `bson:"originatingCommand,omitempty" json:"originatingCommand,omitempty"`
	UpdateObj          bson.D `bson:"updateobj,omitempty" json:"updateobj,omitempty"`
}

ExampleQuery is a subset of SystemProfile

func NewExampleQuery

func NewExampleQuery(doc SystemProfile) ExampleQuery

func (ExampleQuery) Db

func (self ExampleQuery) Db() string

func (ExampleQuery) ExplainCmd

func (self ExampleQuery) ExplainCmd() bson.D

ExplainCmd returns bson.D ready to use in https://godoc.org/labix.org/v2/mgo#Database.Run

type Extra

type Extra struct {
	LibcVersion      string  `bson:"libcVersion"`
	PageSize         float64 `bson:"pageSize"`
	VersionSignature string  `bson:"versionSignature"`
	NumPages         float64 `bson:"numPages"`
	VersionString    string  `bson:"versionString"`
	CpuFeatures      string  `bson:"cpuFeatures"`
	CpuFrequencyMHz  string  `bson:"cpuFrequencyMHz"`
	KernelVersion    string  `bson:"kernelVersion"`
	MaxOpenFiles     float64 `bson:"maxOpenFiles"`
}

type ExtraInfo

type ExtraInfo struct {
	PageFaults     float64 `bson:"page_faults"`
	HeapUsageBytes float64 `bson:"heap_usage_bytes"`
	Note           string  `bson:"note"`
}

type FlushStats

type FlushStats struct {
	Flushes      int64     `bson:"flushes"`
	TotalMs      int64     `bson:"total_ms"`
	AverageMs    float64   `bson:"average_ms"`
	LastMs       int64     `bson:"last_ms"`
	LastFinished time.Time `bson:"last_finished"`
}

FlushStats stores information about memory flushes.

type GetLastError

type GetLastError struct {
	Wtimeouts   float64 `bson:"wtimeouts"`
	Num         float64 `bson:"wtime.num"`
	TotalMillis float64 `bson:"wtime.totalMillis"`
}

type GetLastErrorDefaults

type GetLastErrorDefaults struct {
	Journal      bool  `bson:"j,omitempty"`        // If true, wait for the next journal commit before returning, rather than waiting for a full disk flush.
	WriteConcern int64 `bson:"w,omitempty"`        // When running with replication, this is the number of servers to replicate to before returning.
	WTimeout     int64 `bson:"wtimeout,omitempty"` // Optional. Milliseconds. Specify a value in milliseconds to control how long to wait for write propagation to complete.
}

https://docs.mongodb.com/v3.2/reference/command/getLastError/#dbcmd.getLastError

type GetLastErrorModes

type GetLastErrorModes map[string]*ReplicaSetConfigTags

type GlobalLock

type GlobalLock struct {
	ActiveClients *ActiveClients `bson:"activeClients"`
	CurrentQueue  *CurrentQueue  `bson:"currentQueue"`
	TotalTime     int64          `bson:"totalTime"`
}

type GlobalLockStats

type GlobalLockStats struct {
	TotalTime     int64        `bson:"totalTime"`
	LockTime      int64        `bson:"lockTime"`
	CurrentQueue  *QueueStats  `bson:"currentQueue"`
	ActiveClients *ClientStats `bson:"activeClients"`
}

GlobalLockStats stores information related locks in the MMAP storage engine.

type HTTP

type HTTP struct {
	Enabled              bool    `bson:"enabled"`
	Port                 float64 `bson:"port"`
	JSONPEnabled         bool    `bson:"JSONPEnabled"`
	RESTInterfaceEnabled bool    `bson:"RESTInterfaceEnabled"`
}

type HostInfo

type HostInfo struct {
	Extra  *Extra  `bson:"extra"`
	Os     *Os     `bson:"os"`
	System *System `bson:"system"`
	ID     int
}

HostInfo has exported field for the 'hostInfo' command plus some other fields like Database/Collections count. We are setting those fields into a separated function

type Inprog

type Inprog struct {
	Desc             string             `bson:"desc"`
	ConnectionId     float64            `bson:"connectionId"`
	Opid             float64            `bson:"opid"`
	Msg              string             `bson:"msg"`
	NumYields        float64            `bson:"numYields"`
	Locks            Locks              `bson:"locks"`
	WaitingForLock   float64            `bson:"waitingForLock"`
	ThreadId         string             `bson:"threadId"`
	Active           float64            `bson:"active"`
	MicrosecsRunning float64            `bson:"microsecs_running"`
	SecsRunning      float64            `bson:"secs_running"`
	Op               string             `bson:"op"`
	Ns               string             `bson:"ns"`
	Insert           interface{}        `bson:"insert"`
	PlanSummary      string             `bson:"planSummary"`
	Client           string             `bson:"client"`
	Query            Query              `bson:"query"`
	Progress         Progress           `bson:"progress"`
	KillPending      float64            `bson:"killPending"`
	LockStats        CurrentOpLockStats `bson:"lockStats"`
}

type LockInfo

type LockInfo struct {
	DeadlockCount       AcquireCount `bson:"deadlockCount"`
	AcquireCount        AcquireCount `bson:"acquireCount"`
	AcquireWaitCount    AcquireCount `bson:"acquireWaitCount"`
	TimeAcquiringMicros AcquireCount `bson:"timeAcquiringMicros"`
}

type LockStats

type LockStats struct {
	TimeLockedMicros    ReadWriteLockTimes `bson:"timeLockedMicros"`
	TimeAcquiringMicros ReadWriteLockTimes `bson:"timeAcquiringMicros"`

	// AcquireCount and AcquireWaitCount are new fields of the lock stats only populated on 3.0 or newer.
	// Typed as a pointer so that if it is nil, mongostat can assume the field is not populated
	// with real namespace data.
	AcquireCount     *ReadWriteLockTimes `bson:"acquireCount,omitempty"`
	AcquireWaitCount *ReadWriteLockTimes `bson:"acquireWaitCount,omitempty"`
}

LockStats stores information related to time spent acquiring/holding locks for a given database.

type Locks

type Locks struct {
	Global        LockInfo `bson:"Global"`
	MMAPV1Journal LockInfo `bson:"MMAPV1Journal"`
	Database      LockInfo `bson:"Database"`
	Collection    LockInfo `bson:"Collection"`
	Metadata      LockInfo `bson:"Metadata"`
	Oplog         LockInfo `bson:"oplog"`
}

type MasterDoc

type MasterDoc struct {
	SetName interface{} `bson:"setName"`
	Hosts   interface{} `bson:"hosts"`
	Msg     string      `bson:"msg"`
}

type Mem

type Mem struct {
	Bits              float64 `bson:"bits"`
	Mapped            float64 `bson:"mapped"`
	MappedWithJournal float64 `bson:"mappedWithJournal"`
	Resident          float64 `bson:"resident"`
	Supported         bool    `bson:"supported"`
	Virtual           float64 `bson:"virtual"`
}

type MemStats

type MemStats struct {
	Bits              int64       `bson:"bits"`
	Resident          int64       `bson:"resident"`
	Virtual           int64       `bson:"virtual"`
	Supported         interface{} `bson:"supported"`
	Mapped            int64       `bson:"mapped"`
	MappedWithJournal int64       `bson:"mappedWithJournal"`
}

MemStats stores data related to memory statistics.

type Members

type Members struct {
	Optime        map[string]Optime   `bson:"optimes"`       // See Optime struct
	OptimeDate    primitive.DateTime  `bson:"optimeDate"`    // The last entry from the oplog that this member applied.
	InfoMessage   string              `bson:"infoMessage"`   // A message
	ID            int64               `bson:"_id"`           // Server ID
	Name          string              `bson:"name"`          // server name
	Health        float64             `bson:"health"`        // This field conveys if the member is up (i.e. 1) or down (i.e. 0).
	StateStr      string              `bson:"stateStr"`      // A string that describes state.
	Uptime        float64             `bson:"uptime"`        // number of seconds that this member has been online.
	ConfigVersion float64             `bson:"configVersion"` // revision # of the replica set configuration object from previous iterations of the configuration.
	Self          bool                `bson:"self"`          // true if this is the server we are currently connected
	State         float64             `bson:"state"`         // integer between 0 and 10 that represents the replica state of the member.
	ElectionTime  primitive.Timestamp `bson:"electionTime"`  // For the current primary, information regarding the election Timestamp from the operation log.
	ElectionDate  primitive.DateTime  `bson:"electionDate"`  // For the current primary, an ISODate formatted date string that reflects the election date
	Set           string              `bson:"-"`
	StorageEngine StorageEngine
}

type MetricStats

type MetricStats struct {
	Num         float64 `bson:"num"`
	TotalMillis float64 `bson:"totalMillis"`
}

type Metrics

type Metrics struct {
	Commands      map[string]CommandStats `bson:"commands"`
	Cursor        *Cursor                 `bson:"cursor"`
	Document      *Document               `bson:"document"`
	GetLastError  *GetLastError           `bson:"getLastError"`
	Moves         float64                 `bson:"record.moves"`
	Operation     *Operation              `bson:"operation"`
	QueryExecutor *QueryExecutor          `bson:"queryExecutor"`
	Repl          *ReplMetrics            `bson:"repl"`
	Storage       *Storage                `bson:"storage"`
	Ttl           *Ttl                    `bson:"ttl"`
}

type Net

type Net struct {
	HTTP                   HTTP   `bson:"http"`
	SSL                    SSL    `bson:"ssl"`
	Port                   int64  `bson:"port"`
	BindIP                 string `bson:"bindIp"`
	MaxIncomingConnections int    `bson:"maxIncomingConnections"`
	WireObjectCheck        bool   `bson:"wireObjectCheck"`
	IPv6                   bool   `bson:"ipv6"`
	UnixDomainSocket       struct {
		Enabled         bool   `bson:"enabled"`
		PathPrefix      string `bson:"pathPrefix"`
		FilePermissions int64  `bson:"filePermissions"`
	} `bson:"unixDomainSocket"`
}

NET config options. See https://docs.mongodb.com/manual/reference/configuration-options/#net-options

type Network

type Network struct {
	BytesIn     float64 `bson:"bytesIn"`
	BytesOut    float64 `bson:"bytesOut"`
	NumRequests float64 `bson:"numRequests"`
}

type NetworkStats

type NetworkStats struct {
	BytesIn     int64 `bson:"bytesIn"`
	BytesOut    int64 `bson:"bytesOut"`
	NumRequests int64 `bson:"numRequests"`
}

NetworkStats stores information related to network traffic.

type OpLogs

type OpLogs []OplogInfo

func (OpLogs) Len

func (s OpLogs) Len() int

func (OpLogs) Less

func (s OpLogs) Less(i, j int) bool

func (OpLogs) Swap

func (s OpLogs) Swap(i, j int)

type OpcountStats

type OpcountStats struct {
	Command int64 `bson:"command"`
	Delete  int64 `bson:"delete"`
	GetMore int64 `bson:"getmore"`
	Insert  int64 `bson:"insert"`
	Query   int64 `bson:"query"`
	Update  int64 `bson:"update"`
}

OpcountStats stores information related to comamnds and basic CRUD operations.

type Opcounters

type Opcounters struct {
	Command float64 `bson:"command"`
	Delete  float64 `bson:"delete"`
	Getmore float64 `bson:"getmore"`
	Insert  float64 `bson:"insert"`
	Query   float64 `bson:"query"`
	Update  float64 `bson:"update"`
}

type Operation

type Operation struct {
	Fastmod        float64 `bson:"fastmod"`
	Idhack         float64 `bson:"idhack"`
	ScanAndOrder   float64 `bson:"scanAndOrder"`
	WriteConflicts float64 `bson:"writeConflicts"`
}

type OplogColStats

type OplogColStats struct {
	NumExtents        int
	IndexDetails      bson.M
	Nindexes          int
	TotalIndexSize    int64
	Size              int64
	PaddingFactorNote string
	Capped            bool
	MaxSize           int64
	IndexSizes        bson.M
	GleStats          struct {
		LastOpTime time.Time
		ElectionId string
	} `bson:"$gleStats"`
	StorageSize    int64
	PaddingFactor  int64
	AvgObjSize     int64
	LastExtentSize int64
	UserFlags      int64
	Max            int64
	Ok             int
	Ns             string
	Count          int64
}

type OplogEntry

type OplogEntry struct {
	Name    string
	Options struct {
		Capped      bool
		Size        int64
		AutoIndexId bool
	}
}

type OplogInfo

type OplogInfo struct {
	Hostname      string
	Size          int64
	UsedMB        int64
	TimeDiff      time.Duration
	TimeDiffHours float64
	Running       string // TimeDiffHours in human readable format
	TFirst        time.Time
	TLast         time.Time
	Now           time.Time
	ElectionTime  time.Time
}

type OplogRow

type OplogRow struct {
	Timestamp primitive.Timestamp `bson:"ts,omitempty"`
	HistoryId int64               `bson:"h,omitempty"`
	Version   int64               `bson:"v,omitempty"`
	Operation string              `bson:"op,omitempty"`
	Namespace string              `bson:"ns,omitempty"`
	Object    bson.D              `bson:"o,omitempty"`
	Query     bson.D              `bson:"o2,omitempty"`
}

type Optime

type Optime struct {
	Ts primitive.Timestamp `bson:"ts"` // The Timestamp of the last operation applied to this member of the replica set from the oplog.
	T  float64             `bson:"t"`  // The term in which the last applied operation was originally generated on the primary.
}

type Os

type Os struct {
	Type    string `bson:"type"`
	Version string `bson:"version"`
	Name    string `bson:"name"`
}

type Parsed

type Parsed struct {
	Sharding          Sharding          `bson:"sharding"`
	Storage           CloStorage        `bson:"storage"`
	SystemLog         CloSystemLog      `bson:"systemLog"`
	Net               Net               `bson:"net"`
	ProcessManagement ProcessManagement `bson:"processManagement"`
	Replication       Replication       `bson:"replication"`
	Security          Security          `bson:"security"`
}

type ProcessManagement

type ProcessManagement struct {
	Fork bool `bson:"fork"`
}

type ProfilerStatus

type ProfilerStatus struct {
	Was      int64 `bson:"was"`
	SlowMs   int64 `bson:"slowms"`
	GleStats struct {
		ElectionID string `bson:"electionId"`
		LastOpTime int64  `bson:"lastOpTime"`
	} `bson:"$gleStats"`
}

ProfilerStatus is a struct to hold the results of db.getProfilingLevel()

var ps proto.ProfilerStatus
err := db.Run(bson.M{"profile": -1}, &ps)

type Progress

type Progress struct {
	Done  float64 `bson:"done"`
	Total float64 `bson:"total"`
}

type Query

type Query struct {
	CurrentOp float64 `bson:"currentOp"`
}

type QueryExecutor

type QueryExecutor struct {
	Scanned        float64 `bson:"scanned"`
	ScannedObjects float64 `bson:"scannedObjects"`
}

type QueueStats

type QueueStats struct {
	Total   int64 `bson:"total"`
	Readers int64 `bson:"readers"`
	Writers int64 `bson:"writers"`
}

QueueStats stores the number of queued read/write operations.

type ReadWriteLockTimes

type ReadWriteLockTimes struct {
	Read       int64 `bson:"R"`
	Write      int64 `bson:"W"`
	ReadLower  int64 `bson:"r"`
	WriteLower int64 `bson:"w"`
}

ReadWriteLockTimes stores time spent holding read/write locks.

type RecordAccesses

type RecordAccesses struct {
	AccessesNotInMemory       int64 `bson:"accessesNotInMemory"`
	PageFaultExceptionsThrown int64 `bson:"pageFaultExceptionsThrown"`
}

RecordAccesses stores data related to memory operations scoped to a database.

type Repl

type Repl struct {
	Rbid       float64  `bson:"rbid"`
	SetVersion float64  `bson:"setVersion"`
	ElectionId string   `bson:"electionId"`
	Primary    string   `bson:"primary"`
	Me         string   `bson:"me"`
	Secondary  bool     `bson:"secondary"`
	SetName    string   `bson:"setName"`
	Hosts      []string `bson:"hosts"`
	Ismaster   bool     `bson:"ismaster"`
}

type ReplMetrics

type ReplMetrics struct {
	Batches            *MetricStats `bson:"apply.batches"`
	BufferSizeBytes    float64      `bson:"buffer.sizeBytes"`
	BufferCount        float64      `bson:"buffer.count"`
	BufferMaxSizeBytes float64      `bson:"buffer.maxSizeBytes"`
	Network            *ReplNetwork `bson:"network"`
	Ops                float64      `bson:"apply.ops"`
	PreloadDocs        *MetricStats `bson:"preload.docs"`
	PreloadIndexes     *MetricStats `bson:"preload.indexes"`
}

type ReplNetwork

type ReplNetwork struct {
	Getmores       *MetricStats `bson:"getmores"`
	Ops            float64      `bson:"ops"`
	ReadersCreated float64      `bson:"readersCreated"`
	Bytes          float64      `bson:"bytes"`
}

type ReplStatus

type ReplStatus struct {
	SetName      string      `bson:"setName"`
	IsMaster     interface{} `bson:"ismaster"`
	Secondary    interface{} `bson:"secondary"`
	IsReplicaSet interface{} `bson:"isreplicaset"`
	ArbiterOnly  interface{} `bson:"arbiterOnly"`
	Hosts        []string    `bson:"hosts"`
	Passives     []string    `bson:"passives"`
	Me           string      `bson:"me"`
}

ReplStatus stores data related to replica sets.

type ReplicaSetConfig

type ReplicaSetConfig struct {
	Config struct {
		ID              string                    `bson:"_id,omitempty"`             // The name of the replica set. Once set, you cannot change the name of a replica set.
		ProtocolVersion int64                     `bson:"protocolVersion,omitempty"` // By default, new replica sets in MongoDB 3.2 use protocolVersion: 1. Previous versions of MongoDB use version 0.
		Version         int64                     `bson:"version,omitempty"`         // An incrementing number used to distinguish revisions of the replica set configuration object from previous iterations.
		Members         []*ReplicaSetConfigMember `bson:"members,omitempty"`         // An array of member configuration documents, one for each member of the replica set.
		Settings        *ReplicaSetConfigSettings `bson:"settings,omitempty"`        // A document that contains configuration options that apply to the whole replica set.
	} `bson:"config,omitempty"` // https://docs.mongodb.com/v3.2/reference/replica-configuration/#replica-set-configuration-fields
	Ok int64 `bson:"ok,omitempty"`
}

type ReplicaSetConfigMember

type ReplicaSetConfigMember struct {
	ID           int64                 `bson:"_id,omitempty"`          // An integer identifier of every member in the replica set.
	Host         string                `bson:"host,omitempty"`         // The hostname and, if specified, the port number, of the set member.
	ArbiterOnly  bool                  `bson:"arbiterOnly,omitempty"`  // A boolean that identifies an arbiter. A value of true indicates that the member is an arbiter.
	BuildIndexes bool                  `bson:"buildIndexes,omitempty"` // A boolean that indicates whether the mongod builds indexes on this member.
	Hidden       bool                  `bson:"hidden,omitempty"`       // When this value is true, the replica set hides this instance and does not include the member in the output of db.isMaster() or isMaster.
	Priority     int64                 `bson:"priority,omitempty"`     // A number that indicates the relative eligibility of a member to become a primary.
	Tags         *ReplicaSetConfigTags `bson:"tags,omitempty"`         // A tag set document containing mappings of arbitrary keys and values.
	SlaveDelay   int64                 `bson:"slaveDelay,omitempty"`   // The number of seconds “behind” the primary that this replica set member should “lag”.
	Votes        int64                 `bson:"votes,omitempty"`        // The number of votes a server will cast in a replica set election.
}

https://docs.mongodb.com/v3.2/reference/replica-configuration/#rsconf.members

type ReplicaSetConfigSettings

type ReplicaSetConfigSettings struct {
	ChainingAllowed         bool                  `bson:"chainingAllowed,omitempty"`         // When chainingAllowed is true, the replica set allows secondary members to replicate from other secondary members.
	HeartbeatTimeoutSecs    int64                 `bson:"heartbeatTimeoutSecs,omitempty"`    // Number of seconds that the replica set members wait for a successful heartbeat from each other.
	HeartbeatIntervalMillis int64                 `bson:"heartbeatIntervalMillis,omitempty"` // The frequency in milliseconds of the heartbeats.
	ElectionTimeoutMillis   int64                 `bson:"electionTimeoutMillis,omitempty"`   // The time limit in milliseconds for detecting when a replica set’s primary is unreachable.
	GetLastErrorDefaults    *GetLastErrorDefaults `bson:"getLastErrorDefaults,omitempty"`    // A document that specifies the write concern for the replica set.
	GetLastErrorModes       *GetLastErrorModes    `bson:"getLastErrorModes,omitempty"`       // A document used to define an extended write concern through the use of members[n].tags.
	ReplicaSetId            *primitive.ObjectID   `bson:"replicaSetId,omitempty"`            // Replset Id (ObjectId)
}

https://docs.mongodb.com/v3.2/reference/replica-configuration/#rsconf.settings

type ReplicaSetConfigTags

type ReplicaSetConfigTags map[string]string

type ReplicaSetStatus

type ReplicaSetStatus struct {
	Date                    primitive.DateTime `bson:"date"`                    // Current date
	MyState                 float64            `bson:"myState"`                 // Integer between 0 and 10 that represents the replica state of the current member
	Term                    float64            `bson:"term"`                    // The election count for the replica set, as known to this replica set member. Mongo 3.2+
	HeartbeatIntervalMillis float64            `bson:"heartbeatIntervalMillis"` // The frequency in milliseconds of the heartbeats. 3.2+
	Members                 []Members          `bson:"members"`                 //
	Ok                      float64            `bson:"ok"`                      //
	Set                     string             `bson:"set"`                     // Replica set name
}

Struct for replSetGetStatus

type Replication

type Replication struct {
	ReplSet string `bson:"replSet"`
}

type SSL

type SSL struct {
	SSLOnNormalPorts                    bool   `bson:"sslOnNormalPorts"` // deprecated since 2.6
	Mode                                string `bson:"mode"`             // disabled, allowSSL, preferSSL, requireSSL
	PEMKeyFile                          string `bson:"PEMKeyFile"`
	PEMKeyPassword                      string `bson:"PEMKeyPassword"`
	ClusterFile                         string `bson:"clusterFile"`
	ClusterPassword                     string `bson:"clusterPassword"`
	CAFile                              string `bson:"CAFile"`
	CRLFile                             string `bson:"CRLFile"`
	AllowConnectionsWithoutCertificates bool   `bson:"allowConnectionsWithoutCertificates"`
	AllowInvalidCertificates            bool   `bson:"allowInvalidCertificates"`
	AllowInvalidHostnames               bool   `bson:"allowInvalidHostnames"`
	DisabledProtocols                   string `bson:"disabledProtocols"`
	FIPSMode                            bool   `bson:"FIPSMode"`
}

SSL config options. See https://docs.mongodb.com/manual/reference/configuration-options/#net-ssl-options

type Security

type Security struct {
	KeyFile           string `bson:"keyFile"`
	ClusterAuthMode   string `bson:"clusterAuthMode"`
	Authorization     string `bson:"authorization"`
	JavascriptEnabled bool   `bson:javascriptEnabled"`
	Sasl              struct {
		HostName            string `bson:"hostName"`
		ServiceName         string `bson:"serverName"`
		SaslauthdSocketPath string `bson:"saslauthdSocketPath"`
	} `bson:"sasl"`
	EnableEncryption     bool   `bson:"enableEncryption"`
	EncryptionCipherMode string `bson:"encryptionCipherMode"`
	EncryptionKeyFile    string `bson:"encryptionKeyFile"`
	Kmip                 struct {
		KeyIdentifier             string `bson:"keyIdentifier"`
		RotateMasterKey           bool   `bson:"rotateMasterKey"`
		ServerName                string `bson:"serverName"`
		Port                      string `bson:"port"`
		ClientCertificateFile     string `bson:"clientCertificateFile"`
		ClientCertificatePassword string `bson:"clientCertificatePassword"`
		ServerCAFile              string `bson:"serverCAFile"`
	} `bson:"kmip"`
}

Security is a struct to hold security related configs

type ServerStatus

type ServerStatus struct {
	Host               string                 `bson:"host"`
	Version            string                 `bson:"version"`
	Process            string                 `bson:"process"`
	Pid                int64                  `bson:"pid"`
	Uptime             int64                  `bson:"uptime"`
	UptimeMillis       int64                  `bson:"uptimeMillis"`
	UptimeEstimate     int64                  `bson:"uptimeEstimate"`
	LocalTime          time.Time              `bson:"localTime"`
	Asserts            map[string]int64       `bson:"asserts"`
	BackgroundFlushing *FlushStats            `bson:"backgroundFlushing"`
	ExtraInfo          *ExtraInfo             `bson:"extra_info"`
	Connections        *ConnectionStats       `bson:"connections"`
	Dur                *DurStats              `bson:"dur"`
	GlobalLock         *GlobalLockStats       `bson:"globalLock"`
	Locks              map[string]LockStats   `bson:"locks,omitempty"`
	Network            *NetworkStats          `bson:"network"`
	Opcounters         *OpcountStats          `bson:"opcounters"`
	OpcountersRepl     *OpcountStats          `bson:"opcountersRepl"`
	RecordStats        *DBRecordStats         `bson:"recordStats"`
	Mem                *MemStats              `bson:"mem"`
	Repl               *ReplStatus            `bson:"repl"`
	ShardCursorType    map[string]interface{} `bson:"shardCursorType"`
	StorageEngine      StorageEngine          `bson:"storageEngine"`
	WiredTiger         *WiredTiger            `bson:"wiredTiger"`
}

type Shard

type Shard struct {
	ID   string `bson:"_id"`
	Host string `bson:"host"`
}

type ShardStas

type ShardStas struct {
	Ns                string `json:"ns"`
	Count             int64  `json:"count"`
	Size              int64  `json:"size"`
	AvgObjSize        int64  `json:"avgObjSize"`
	NumExtents        int64  `json:"numExtents"`
	StorageSize       int64  `json:"storageSize"`
	LastExtentSize    int64  `json:"lastExtentSize"`
	PaddingFactor     int64  `json:"paddingFactor"`
	PaddingFactorNote string `json:"paddingFactorNote"`
	UserFlags         int64  `json:"userFlags"`
	Capped            bool   `json:"capped"`
	Nindexes          int64  `json:"nindexes"`
	IndexDetails      struct {
	} `json:"indexDetails"`
	TotalIndexSize int64 `json:"totalIndexSize"`
	IndexSizes     struct {
		ID       int64 `json:"_id_"`
		IDHashed int64 `json:"_id_hashed"`
	} `json:"indexSizes"`
	Ok int `json:"ok"`
}

type Sharding

type Sharding struct {
	ClusterRole string `bson:"clusterRole"`
}

type ShardingChangelogStats

type ShardingChangelogStats struct {
	Items *[]ShardingChangelogSummary
}

type ShardingChangelogSummary

type ShardingChangelogSummary struct {
	Id    *ShardingChangelogSummaryId `bson:"_id"`
	Count float64                     `bson:"count"`
}

type ShardingChangelogSummaryId

type ShardingChangelogSummaryId struct {
	Event string `bson:"event"`
	Note  string `bson:"note"`
}

type ShardsInfo

type ShardsInfo struct {
	Shards []Shard `bson:"shards"`
	OK     int     `bson:"ok"`
}

type ShardsMap

type ShardsMap struct {
	Map map[string]string `bson:"map"`
	OK  int               `bson:"ok"`
}

type Storage

type Storage struct {
	BucketExhausted float64 `bson:"freelist.search.bucketExhausted"`
	Requests        float64 `bson:"freelist.search.requests"`
	Scanned         float64 `bson:"freelist.search.scanned"`
}

type StorageEngine

type StorageEngine struct {
	Name                  string `bson:"name"`
	SupportCommittedREads bool   `bson:supportsCommittedReads"`
	ReadOnly              bool   `bson:"readOnly"`
	Persistent            bool   `bson:"persistent"`
}

type System

type System struct {
	CurrentTime primitive.DateTime `bson:"currentTime"`
	Hostname    string             `bson:"hostname"`
	MemSizeMB   float64            `bson:"memSizeMB"`
	NumCores    float64            `bson:"numCores"`
	NumaEnabled bool               `bson:"numaEnabled"`
	CpuAddrSize float64            `bson:"cpuAddrSize"`
	CpuArch     string             `bson:"cpuArch"`
}

type SystemProfile

type SystemProfile struct {
	AllUsers        []interface{} `bson:"allUsers"`
	Client          string        `bson:"client"`
	CursorExhausted bool          `bson:"cursorExhausted"`
	DocsExamined    int           `bson:"docsExamined"`
	NscannedObjects int           `bson:"nscannedObjects"`
	ExecStats       struct {
		Advanced                    int `bson:"advanced"`
		ExecutionTimeMillisEstimate int `bson:"executionTimeMillisEstimate"`
		InputStage                  struct {
			Advanced                    int    `bson:"advanced"`
			Direction                   string `bson:"direction"`
			DocsExamined                int    `bson:"docsExamined"`
			ExecutionTimeMillisEstimate int    `bson:"executionTimeMillisEstimate"`
			Filter                      struct {
				Date struct {
					Eq string `bson:"$eq"`
				} `bson:"date"`
			} `bson:"filter"`
			Invalidates  int    `bson:"invalidates"`
			IsEOF        int    `bson:"isEOF"`
			NReturned    int    `bson:"nReturned"`
			NeedTime     int    `bson:"needTime"`
			NeedYield    int    `bson:"needYield"`
			RestoreState int    `bson:"restoreState"`
			SaveState    int    `bson:"saveState"`
			Stage        string `bson:"stage"`
			Works        int    `bson:"works"`
		} `bson:"inputStage"`
		Invalidates  int    `bson:"invalidates"`
		IsEOF        int    `bson:"isEOF"`
		LimitAmount  int    `bson:"limitAmount"`
		NReturned    int    `bson:"nReturned"`
		NeedTime     int    `bson:"needTime"`
		NeedYield    int    `bson:"needYield"`
		RestoreState int    `bson:"restoreState"`
		SaveState    int    `bson:"saveState"`
		Stage        string `bson:"stage"`
		Works        int    `bson:"works"`
	} `bson:"execStats"`
	KeyUpdates   int `bson:"keyUpdates"`
	KeysExamined int `bson:"keysExamined"`
	Locks        struct {
		Collection struct {
			AcquireCount struct {
				R int `bson:"R"`
			} `bson:"acquireCount"`
		} `bson:"Collection"`
		Database struct {
			AcquireCount struct {
				R int `bson:"r"`
			} `bson:"acquireCount"`
		} `bson:"Database"`
		Global struct {
			AcquireCount struct {
				R int `bson:"r"`
			} `bson:"acquireCount"`
		} `bson:"Global"`
		MMAPV1Journal struct {
			AcquireCount struct {
				R int `bson:"r"`
			} `bson:"acquireCount"`
		} `bson:"MMAPV1Journal"`
	} `bson:"locks"`
	Millis             int       `bson:"millis"`
	Nreturned          int       `bson:"nreturned"`
	Ns                 string    `bson:"ns"`
	NumYield           int       `bson:"numYield"`
	Op                 string    `bson:"op"`
	Protocol           string    `bson:"protocol"`
	Query              bson.D    `bson:"query"`
	UpdateObj          bson.D    `bson:"updateobj"`
	Command            bson.D    `bson:"command"`
	OriginatingCommand bson.D    `bson:"originatingCommand"`
	ResponseLength     int       `bson:"responseLength"`
	Ts                 time.Time `bson:"ts"`
	User               string    `bson:"user"`
	WriteConflicts     int       `bson:"writeConflicts"`
}

docsExamined is renamed from nscannedObjects in 3.2.0 https://docs.mongodb.com/manual/reference/database-profiler/#system.profile.docsExamined

type TimeMs

type TimeMs struct {
	WriteToDataFiles   float64 `bson:"writeToDataFiles"`
	WriteToJournal     float64 `bson:"writeToJournal"`
	Commits            float64 `bson:"commits"`
	CommitsInWriteLock float64 `bson:"commitsInWriteLock"`
	Dt                 float64 `bson:"dt"`
	PrepLogBuffer      float64 `bson:"prepLogBuffer"`
	RemapPrivateView   float64 `bson:"remapPrivateView"`
}

type TransactionStats

type TransactionStats struct {
	TransCheckpoints int64 `bson:"transaction checkpoints"`
}

TransactionStats stores transaction checkpoints in WiredTiger.

type Ttl

type Ttl struct {
	DeletedDocuments float64 `bson:"deletedDocuments"`
	Passes           float64 `bson:"passes"`
}

type WiredTiger

type WiredTiger struct {
	Transaction TransactionStats       `bson:"transaction"`
	Concurrent  ConcurrentTransactions `bson:"concurrentTransactions"`
	Cache       CacheStats             `bson:"cache"`
}

WiredTiger stores information related to the WiredTiger storage engine.

Jump to

Keyboard shortcuts

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