collector_mongod

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Namespace is the namespace of the metrics
	Namespace = "mongodb_mongod"
)

Functions

func BsonMongoTimestampToUnix

func BsonMongoTimestampToUnix(timestamp bson.MongoTimestamp) float64

there's gotta be a better way to do this, but it works for now :/

func ParseStr

func ParseStr(str string) float64

rocksdb metric string parser: converts string-numbers to float64s and parses metric units (MB, KB, etc):

func ParseTime

func ParseTime(str string) float64

rocksdb time-format string parser: returns float64 of seconds:

func SplitByWs

func SplitByWs(str string) []string

splits strings with multi-whitespace delimeters into a slice:

Types

type ApplyStats

type ApplyStats struct {
	Batches *BenchmarkStats `bson:"batches"`
	Ops     float64         `bson:"ops"`
}

ApplyStats are the stats associated with the apply operation.

func (*ApplyStats) Export

func (applyStats *ApplyStats) Export(ch chan<- prometheus.Metric)

Export exports the apply stats

type AssertsStats

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

AssertsStats has the assets metrics

func (*AssertsStats) Describe

func (asserts *AssertsStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*AssertsStats) Export

func (asserts *AssertsStats) Export(ch chan<- prometheus.Metric)

Export exports the metrics to prometheus.

type BenchmarkStats

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

BenchmarkStats is bechmark info about an operation.

type BufferStats

type BufferStats struct {
	Count        float64 `bson:"count"`
	MaxSizeBytes float64 `bson:"maxSizeBytes"`
	SizeBytes    float64 `bson:"sizeBytes"`
}

BufferStats are the stats associated with the buffer

func (*BufferStats) Export

func (bufferStats *BufferStats) Export(ch chan<- prometheus.Metric)

Export exports the buffer stats.

type ClientStats

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

ClientStats metrics for client stats

func (*ClientStats) Export

func (clientStats *ClientStats) Export(ch chan<- prometheus.Metric)

Export exports the metrics to prometheus

type ConnectionStats

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

ConnectionStats are connections metrics

func (*ConnectionStats) Describe

func (connectionStats *ConnectionStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*ConnectionStats) Export

func (connectionStats *ConnectionStats) Export(ch chan<- prometheus.Metric)

Export exports the data to prometheus.

type CursorStats

type CursorStats struct {
	TimedOut float64          `bson:"timedOut"`
	Open     *CursorStatsOpen `bson:"open"`
}

CursorStats are the stats for cursors

func (*CursorStats) Export

func (cursorStats *CursorStats) Export(ch chan<- prometheus.Metric)

Export exports the cursor stats.

type CursorStatsOpen

type CursorStatsOpen struct {
	NoTimeout float64 `bson:"noTimeout"`
	Pinned    float64 `bson:"pinned"`
	Total     float64 `bson:"total"`
}

CursorStatsOpen are the stats for open cursors

type Cursors

type Cursors struct {
	TotalOpen      float64 `bson:"totalOpen"`
	TimeOut        float64 `bson:"timedOut"`
	TotalNoTimeout float64 `bson:"totalNoTimeout"`
	Pinned         float64 `bson:"pinned"`
}

Cursors are the cursor metrics

func (*Cursors) Describe

func (cursors *Cursors) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*Cursors) Export

func (cursors *Cursors) Export(ch chan<- prometheus.Metric)

Export exports the data to prometheus.

type DocumentStats

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

DocumentStats are the stats associated to a document.

func (*DocumentStats) Export

func (documentStats *DocumentStats) Export(ch chan<- prometheus.Metric)

Export exposes the document stats to be consumed by the prometheus server.

type DurStats

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

DurStats are the stats related to durability.

func (*DurStats) Collect

func (durStats *DurStats) Collect(ch chan<- prometheus.Metric)

Collect collects the metrics for prometheus

func (*DurStats) Describe

func (durStats *DurStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*DurStats) Export

func (durStats *DurStats) Export(ch chan<- prometheus.Metric)

Export export the durability stats for the prometheus server.

type DurTiming

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

DurTiming is the information about durability returned from the server.

func (*DurTiming) Export

func (durTiming *DurTiming) Export(ch chan<- prometheus.Metric)

Export exports the data for the prometheus server.

type ExtraInfo

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

ExtraInfo has extra info metrics

func (*ExtraInfo) Describe

func (extraInfo *ExtraInfo) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*ExtraInfo) Export

func (extraInfo *ExtraInfo) Export(ch chan<- prometheus.Metric)

Export exports the metrics to prometheus.

type FlushStats

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

FlushStats is the flush stats metrics

func (*FlushStats) Describe

func (flushStats *FlushStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*FlushStats) Export

func (flushStats *FlushStats) Export(ch chan<- prometheus.Metric)

Export exports the metrics for prometheus.

type GetLastErrorStats

type GetLastErrorStats struct {
	Wtimeouts float64         `bson:"wtimeouts"`
	Wtime     *BenchmarkStats `bson:"wtime"`
}

GetLastErrorStats are the last error stats.

func (*GetLastErrorStats) Export

func (getLastErrorStats *GetLastErrorStats) Export(ch chan<- prometheus.Metric)

Export exposes the get last error stats.

type GlobalLockStats

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

GlobalLockStats global lock stats

func (*GlobalLockStats) Describe

func (globalLock *GlobalLockStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*GlobalLockStats) Export

func (globalLock *GlobalLockStats) Export(ch chan<- prometheus.Metric)

Export exports the metrics to prometheus

type IndexCounterStats

type IndexCounterStats struct {
	Accesses  float64 `bson:"accesses"`
	Hits      float64 `bson:"hits"`
	Misses    float64 `bson:"misses"`
	Resets    float64 `bson:"resets"`
	MissRatio float64 `bson:"missRatio"`
}

IndexCounterStats index counter stats

func (*IndexCounterStats) Describe

func (indexCountersStats *IndexCounterStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*IndexCounterStats) Export

func (indexCountersStats *IndexCounterStats) Export(ch chan<- prometheus.Metric)

Export exports the data to prometheus.

type LockStats

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

LockStats lock stats

type LockStatsMap

type LockStatsMap map[string]LockStats

LockStatsMap is a map of lock stats

func (LockStatsMap) Describe

func (locks LockStatsMap) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (LockStatsMap) Export

func (locks LockStatsMap) Export(ch chan<- prometheus.Metric)

Export exports the data to prometheus.

type MemStats

type MemStats struct {
	Bits              float64 `bson:"bits"`
	Resident          float64 `bson:"resident"`
	Virtual           float64 `bson:"virtual"`
	Mapped            float64 `bson:"mapped"`
	MappedWithJournal float64 `bson:"mappedWithJournal"`
}

MemStats tracks the mem stats metrics.

func (*MemStats) Describe

func (memStats *MemStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*MemStats) Export

func (memStats *MemStats) Export(ch chan<- prometheus.Metric)

Export exports the data to prometheus.

type Member

type Member struct {
	Name                 string      `bson:"name"`
	Self                 *bool       `bson:"self,omitempty"`
	Health               *int32      `bson:"health,omitempty"`
	State                int32       `bson:"state"`
	StateStr             string      `bson:"stateStr"`
	Uptime               float64     `bson:"uptime"`
	Optime               interface{} `bson:"optime"`
	OptimeDate           time.Time   `bson:"optimeDate"`
	ElectionTime         *time.Time  `bson:"electionTime,omitempty"`
	ElectionDate         *time.Time  `bson:"electionDate,omitempty"`
	LastHeartbeat        *time.Time  `bson:"lastHeartbeat,omitempty"`
	LastHeartbeatRecv    *time.Time  `bson:"lastHeartbeatRecv,omitempty"`
	LastHeartbeatMessage *string     `bson:"lastHeartbeatMessage,omitempty"`
	PingMs               *float64    `bson:"pingMs,omitempty"`
	SyncingTo            *string     `bson:"syncingTo,omitempty"`
	ConfigVersion        *int32      `bson:"configVersion,omitempty"`
}

Member represents an array element of ReplSetStatus.Members

type MetricsNetworkStats

type MetricsNetworkStats struct {
	Bytes          float64         `bson:"bytes"`
	Ops            float64         `bson:"ops"`
	GetMores       *BenchmarkStats `bson:"getmores"`
	ReadersCreated float64         `bson:"readersCreated"`
}

MetricsNetworkStats are the network stats.

func (*MetricsNetworkStats) Export

func (metricsNetworkStats *MetricsNetworkStats) Export(ch chan<- prometheus.Metric)

Export exposes the network stats.

type MetricsStats

type MetricsStats struct {
	Document      *DocumentStats      `bson:"document"`
	GetLastError  *GetLastErrorStats  `bson:"getLastError"`
	Operation     *OperationStats     `bson:"operation"`
	QueryExecutor *QueryExecutorStats `bson:"queryExecutor"`
	Record        *RecordStats        `bson:"record"`
	Repl          *ReplStats          `bson:"repl"`
	Storage       *StorageStats       `bson:"storage"`
	Cursor        *CursorStats        `bson:"cursor"`
}

MetricsStats are all stats associated with metrics of the system

func (*MetricsStats) Describe

func (metricsStats *MetricsStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*MetricsStats) Export

func (metricsStats *MetricsStats) Export(ch chan<- prometheus.Metric)

Export exports the metrics stats.

type NetworkStats

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

NetworkStats network stats

func (*NetworkStats) Describe

func (networkStats *NetworkStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*NetworkStats) Export

func (networkStats *NetworkStats) Export(ch chan<- prometheus.Metric)

Export exports the data to prometheus

type OpcountersReplStats

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

OpcountersReplStats opcounters stats

func (*OpcountersReplStats) Describe

func (opCounters *OpcountersReplStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*OpcountersReplStats) Export

func (opCounters *OpcountersReplStats) Export(ch chan<- prometheus.Metric)

Export exports the data to prometheus.

type OpcountersStats

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

OpcountersStats opcounters stats

func (*OpcountersStats) Describe

func (opCounters *OpcountersStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*OpcountersStats) Export

func (opCounters *OpcountersStats) Export(ch chan<- prometheus.Metric)

Export exports the data to prometheus.

type OperationStats

type OperationStats struct {
	Fastmod      float64 `bson:"fastmod"`
	Idhack       float64 `bson:"idhack"`
	ScanAndOrder float64 `bson:"scanAndOrder"`
}

OperationStats are the stats for some kind of operations.

func (*OperationStats) Export

func (operationStats *OperationStats) Export(ch chan<- prometheus.Metric)

Export exports the operation stats.

type OplogCollectionStats

type OplogCollectionStats struct {
	Count       float64 `bson:"count"`
	Size        float64 `bson:"size"`
	StorageSize float64 `bson:"storageSize"`
}

func GetOplogCollectionStats

func GetOplogCollectionStats(session *mgo.Session) (*OplogCollectionStats, error)

type OplogStatus

type OplogStatus struct {
	OplogTimestamps *OplogTimestamps
	CollectionStats *OplogCollectionStats
}

func GetOplogStatus

func GetOplogStatus(session *mgo.Session) *OplogStatus

func (*OplogStatus) Describe

func (status *OplogStatus) Describe(ch chan<- *prometheus.Desc)

func (*OplogStatus) Export

func (status *OplogStatus) Export(ch chan<- prometheus.Metric)

type OplogTimestamps

type OplogTimestamps struct {
	Tail float64
	Head float64
}

func GetOplogTimestamps

func GetOplogTimestamps(session *mgo.Session) (*OplogTimestamps, error)

type PreloadStats

type PreloadStats struct {
	Docs    *BenchmarkStats `bson:"docs"`
	Indexes *BenchmarkStats `bson:"indexes"`
}

PreloadStats are the stats associated with preload operation.

func (*PreloadStats) Export

func (preloadStats *PreloadStats) Export(ch chan<- prometheus.Metric)

Export exposes the preload stats.

type QueryExecutorStats

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

QueryExecutorStats are the stats associated with a query execution.

func (*QueryExecutorStats) Export

func (queryExecutorStats *QueryExecutorStats) Export(ch chan<- prometheus.Metric)

Export exports the query executor stats.

type QueueStats

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

QueueStats queue stats

func (*QueueStats) Export

func (queueStats *QueueStats) Export(ch chan<- prometheus.Metric)

Export exports the metrics to prometheus

type ReadWriteLockTimes

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

ReadWriteLockTimes information about the lock

type RecordStats

type RecordStats struct {
	Moves float64 `bson:"moves"`
}

RecordStats are stats associated with a record.

func (*RecordStats) Export

func (recordStats *RecordStats) Export(ch chan<- prometheus.Metric)

Export exposes the record stats.

type ReplExecutorStats added in v0.2.0

type ReplExecutorStats struct {
	Counters         map[string]float64 `bson:"counters"`
	Queues           map[string]float64 `bson:"queues"`
	EventWaiters     float64            `bson:"eventWaiters"`
	UnsignaledEvents float64            `bson:"unsignaledEvents"`
}

ReplExecutorStats are the stats associated with replication execution

func (*ReplExecutorStats) Export added in v0.2.0

func (replExecutorStats *ReplExecutorStats) Export(ch chan<- prometheus.Metric)

Export replication executor stats

type ReplSetStatus

type ReplSetStatus struct {
	Set                     string    `bson:"set"`
	Date                    time.Time `bson:"date"`
	MyState                 int32     `bson:"myState"`
	Term                    *int32    `bson:"term,omitempty"`
	HeartbeatIntervalMillis *float64  `bson:"heartbeatIntervalMillis,omitempty"`
	Members                 []Member  `bson:"members"`
}

ReplSetStatus keeps the data returned by the GetReplSetStatus method

func GetReplSetStatus

func GetReplSetStatus(session *mgo.Session) *ReplSetStatus

GetReplSetStatus returns the replica status info

func (*ReplSetStatus) Describe

func (replStatus *ReplSetStatus) Describe(ch chan<- *prometheus.Desc)

Describe describes the replSetGetStatus metrics for prometheus

func (*ReplSetStatus) Export

func (replStatus *ReplSetStatus) Export(ch chan<- prometheus.Metric)

Export exports the replSetGetStatus stati to be consumed by prometheus

type ReplStats

type ReplStats struct {
	Apply        *ApplyStats          `bson:"apply"`
	Buffer       *BufferStats         `bson:"buffer"`
	Executor     *ReplExecutorStats   `bson:"executor,omitempty"`
	Network      *MetricsNetworkStats `bson:"network"`
	PreloadStats *PreloadStats        `bson:"preload"`
}

ReplStats are the stats associated with the replication process.

func (*ReplStats) Export

func (replStats *ReplStats) Export(ch chan<- prometheus.Metric)

Export exposes the replication stats.

type RocksDbLevelStats

type RocksDbLevelStats struct {
	Level    string
	Files    *RocksDbLevelStatsFiles
	Score    float64
	SizeMB   float64
	ReadGB   float64
	RnGB     float64
	Rnp1GB   float64
	WriteGB  float64
	WnewGB   float64
	MovedGB  float64
	WAmp     float64
	RdMBPSec float64
	WrMBPSec float64
	CompSec  float64
	CompCnt  float64
	AvgSec   float64
	KeyIn    float64
	KeyDrop  float64
}

func ProcessLevelStatsLine

func ProcessLevelStatsLine(line string) *RocksDbLevelStats

type RocksDbLevelStatsFiles

type RocksDbLevelStatsFiles struct {
	Num         float64
	CompThreads float64
}

func ProcessLevelStatsLineFiles

func ProcessLevelStatsLineFiles(str string) *RocksDbLevelStatsFiles

type RocksDbStats

type RocksDbStats struct {
	NumImmutableMemTable       string                `bson:"num-immutable-mem-table"`
	MemTableFlushPending       string                `bson:"mem-table-flush-pending"`
	CompactionPending          string                `bson:"compaction-pending"`
	BackgroundErrors           string                `bson:"background-errors"`
	CurSizeMemTableActive      string                `bson:"cur-size-active-mem-table"`
	CurSizeAllMemTables        string                `bson:"cur-size-all-mem-tables"`
	NumEntriesMemTableActive   string                `bson:"num-entries-active-mem-table"`
	NumEntriesImmMemTables     string                `bson:"num-entries-imm-mem-tables"`
	EstimateTableReadersMem    string                `bson:"estimate-table-readers-mem"`
	NumSnapshots               string                `bson:"num-snapshots"`
	OldestSnapshotTime         string                `bson:"oldest-snapshot-time"`
	NumLiveVersions            string                `bson:"num-live-versions"`
	BlockCacheUsage            string                `bson:"block-cache-usage"`
	TotalLiveRecoveryUnits     float64               `bson:"total-live-recovery-units"`
	TransactionEngineKeys      float64               `bson:"transaction-engine-keys"`
	TransactionEngineSnapshots float64               `bson:"transaction-engine-snapshots"`
	Stats                      []string              `bson:"stats"`
	ThreadStatus               []string              `bson:"thread-status"`
	Counters                   *RocksDbStatsCounters `bson:"counters,omitempty"`
}

func (*RocksDbStats) Describe

func (stats *RocksDbStats) Describe(ch chan<- *prometheus.Desc)

func (*RocksDbStats) Export

func (stats *RocksDbStats) Export(ch chan<- prometheus.Metric)

func (*RocksDbStats) GetStatsLine

func (stats *RocksDbStats) GetStatsLine(section_prefix string, line_prefix string) []string

func (*RocksDbStats) GetStatsLineField

func (stats *RocksDbStats) GetStatsLineField(section_prefix string, line_prefix string, idx int) float64

func (*RocksDbStats) GetStatsSection

func (stats *RocksDbStats) GetStatsSection(section_prefix string) []string

func (*RocksDbStats) ProcessLevelStats

func (stats *RocksDbStats) ProcessLevelStats()

func (*RocksDbStats) ProcessReadLatencyStats

func (stats *RocksDbStats) ProcessReadLatencyStats()

func (*RocksDbStats) ProcessStalls

func (stats *RocksDbStats) ProcessStalls()

type RocksDbStatsCounters

type RocksDbStatsCounters struct {
	NumKeysWritten         float64 `bson:"num-keys-written"`
	NumKeysRead            float64 `bson:"num-keys-read"`
	NumSeeks               float64 `bson:"num-seeks"`
	NumForwardIter         float64 `bson:"num-forward-iterations"`
	NumBackwardIter        float64 `bson:"num-backward-iterations"`
	BlockCacheMisses       float64 `bson:"block-cache-misses"`
	BlockCacheHits         float64 `bson:"block-cache-hits"`
	BloomFilterUseful      float64 `bson:"bloom-filter-useful"`
	BytesWritten           float64 `bson:"bytes-written"`
	BytesReadPointLookup   float64 `bson:"bytes-read-point-lookup"`
	BytesReadIteration     float64 `bson:"bytes-read-iteration"`
	FlushBytesWritten      float64 `bson:"flush-bytes-written"`
	CompactionBytesRead    float64 `bson:"compaction-bytes-read"`
	CompactionBytesWritten float64 `bson:"compaction-bytes-written"`
}

func (*RocksDbStatsCounters) Describe

func (stats *RocksDbStatsCounters) Describe(ch chan<- *prometheus.Desc)

func (*RocksDbStatsCounters) Export

func (stats *RocksDbStatsCounters) Export(ch chan<- prometheus.Metric)

type ServerStatus

type ServerStatus struct {
	Uptime         float64   `bson:"uptime"`
	UptimeEstimate float64   `bson:"uptimeEstimate"`
	LocalTime      time.Time `bson:"localTime"`

	Asserts *AssertsStats `bson:"asserts"`

	Dur *DurStats `bson:"dur"`

	BackgroundFlushing *FlushStats `bson:"backgroundFlushing"`

	Connections *ConnectionStats `bson:"connections"`

	ExtraInfo *ExtraInfo `bson:"extra_info"`

	GlobalLock *GlobalLockStats `bson:"globalLock"`

	IndexCounter *IndexCounterStats `bson:"indexCounters"`

	Locks LockStatsMap `bson:"locks,omitempty"`

	Network *NetworkStats `bson:"network"`

	Opcounters     *OpcountersStats     `bson:"opcounters"`
	OpcountersRepl *OpcountersReplStats `bson:"opcountersRepl"`
	Mem            *MemStats            `bson:"mem"`
	Metrics        *MetricsStats        `bson:"metrics"`

	Cursors *Cursors `bson:"cursors"`

	StorageEngine *StorageEngineStats `bson:"storageEngine"`
	InMemory      *WiredTigerStats    `bson:"inMemory"`
	RocksDb       *RocksDbStats       `bson:"rocksdb"`
	WiredTiger    *WiredTigerStats    `bson:"wiredTiger"`
}

ServerStatus keeps the data returned by the serverStatus() method.

func GetServerStatus

func GetServerStatus(session *mgo.Session) *ServerStatus

GetServerStatus returns the server status info.

func (*ServerStatus) Describe

func (status *ServerStatus) Describe(ch chan<- *prometheus.Desc)

Describe describes the server status for prometheus.

func (*ServerStatus) Export

func (status *ServerStatus) Export(ch chan<- prometheus.Metric)

Export exports the server status to be consumed by prometheus.

type StorageEngineStats

type StorageEngineStats struct {
	Name string `bson:"name"`
}

StorageEngineStats

func (*StorageEngineStats) Describe

func (stats *StorageEngineStats) Describe(ch chan<- *prometheus.Desc)

Describe describes the metrics for prometheus

func (*StorageEngineStats) Export

func (stats *StorageEngineStats) Export(ch chan<- prometheus.Metric)

Export exports the data to prometheus.

type StorageStats

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

StorageStats are the stats associated with the storage.

func (*StorageStats) Export

func (storageStats *StorageStats) Export(ch chan<- prometheus.Metric)

Export exports the storage stats.

type WTBlockManagerStats

type WTBlockManagerStats struct {
	MappedBytesRead  float64 `bson:"mapped bytes read"`
	BytesRead        float64 `bson:"bytes read"`
	BytesWritten     float64 `bson:"bytes written"`
	MappedBlocksRead float64 `bson:"mapped blocks read"`
	BlocksPreLoaded  float64 `bson:"blocks pre-loaded"`
	BlocksRead       float64 `bson:"blocks read"`
	BlocksWritten    float64 `bson:"blocks written"`
}

blockmanager stats

func (*WTBlockManagerStats) Describe

func (stats *WTBlockManagerStats) Describe(ch chan<- *prometheus.Desc)

func (*WTBlockManagerStats) Export

func (stats *WTBlockManagerStats) Export(ch chan<- prometheus.Metric)

type WTCacheStats

type WTCacheStats struct {
	BytesTotal         float64 `bson:"bytes currently in the cache"`
	BytesDirty         float64 `bson:"tracked dirty bytes in the cache"`
	BytesInternalPages float64 `bson:"tracked bytes belonging to internal pages in the cache"`
	BytesLeafPages     float64 `bson:"tracked bytes belonging to leaf pages in the cache"`
	MaxBytes           float64 `bson:"maximum bytes configured"`
	BytesReadInto      float64 `bson:"bytes read into cache"`
	BytesWrittenFrom   float64 `bson:"bytes written from cache"`
	EvictedUnmodified  float64 `bson:"unmodified pages evicted"`
	EvictedModified    float64 `bson:"modified pages evicted"`
	PercentOverhead    float64 `bson:"percentage overhead"`
	PagesTotal         float64 `bson:"pages currently held in the cache"`
	PagesReadInto      float64 `bson:"pages read into cache"`
	PagesWrittenFrom   float64 `bson:"pages written from cache"`
	PagesDirty         float64 `bson:"tracked dirty pages in the cache"`
}

cache stats

func (*WTCacheStats) Describe

func (stats *WTCacheStats) Describe(ch chan<- *prometheus.Desc)

func (*WTCacheStats) Export

func (stats *WTCacheStats) Export(ch chan<- prometheus.Metric)

type WTConcurrentTransactionsStats

type WTConcurrentTransactionsStats struct {
	Write *WTConcurrentTransactionsTypeStats `bson:"read"`
	Read  *WTConcurrentTransactionsTypeStats `bson:"write"`
}

func (*WTConcurrentTransactionsStats) Describe

func (stats *WTConcurrentTransactionsStats) Describe(ch chan<- *prometheus.Desc)

func (*WTConcurrentTransactionsStats) Export

func (stats *WTConcurrentTransactionsStats) Export(ch chan<- prometheus.Metric)

type WTConcurrentTransactionsTypeStats

type WTConcurrentTransactionsTypeStats struct {
	Out          float64 `bson:"out"`
	Available    float64 `bson:"available"`
	TotalTickets float64 `bson:"totalTickets"`
}

concurrenttransaction stats

type WTLogStats

type WTLogStats struct {
	TotalBufferSize         float64 `bson:"total log buffer size"`
	TotalSizeCompressed     float64 `bson:"total size of compressed records"`
	BytesPayloadData        float64 `bson:"log bytes of payload data"`
	BytesWritten            float64 `bson:"log bytes written"`
	RecordsUncompressed     float64 `bson:"log records not compressed"`
	RecordsCompressed       float64 `bson:"log records compressed"`
	RecordsProcessedLogScan float64 `bson:"records processed by log scan"`
	MaxLogSize              float64 `bson:"maximum log file size"`
	LogFlushes              float64 `bson:"log flush operations"`
	LogReads                float64 `bson:"log read operations"`
	LogScansDouble          float64 `bson:"log scan records requiring two reads"`
	LogScans                float64 `bson:"log scan operations"`
	LogSyncs                float64 `bson:"log sync operations"`
	LogSyncDirs             float64 `bson:"log sync_dir operations"`
	LogWrites               float64 `bson:"log write operations"`
}

log stats

func (*WTLogStats) Describe

func (stats *WTLogStats) Describe(ch chan<- *prometheus.Desc)

func (*WTLogStats) Export

func (stats *WTLogStats) Export(ch chan<- prometheus.Metric)

type WTSessionStats

type WTSessionStats struct {
	Cursors  float64 `bson:"open cursor count"`
	Sessions float64 `bson:"open session count"`
}

session stats

func (*WTSessionStats) Describe

func (stats *WTSessionStats) Describe(ch chan<- *prometheus.Desc)

func (*WTSessionStats) Export

func (stats *WTSessionStats) Export(ch chan<- prometheus.Metric)

type WTTransactionStats

type WTTransactionStats struct {
	Begins               float64 `bson:"transaction begins"`
	Checkpoints          float64 `bson:"transaction checkpoints"`
	CheckpointsRunning   float64 `bson:"transaction checkpoint currently running"`
	CheckpointMaxMs      float64 `bson:"transaction checkpoint max time (msecs)"`
	CheckpointMinMs      float64 `bson:"transaction checkpoint min time (msecs)"`
	CheckpointLastMs     float64 `bson:"transaction checkpoint most recent time (msecs)"`
	CheckpointTotalMs    float64 `bson:"transaction checkpoint total time (msecs)"`
	Committed            float64 `bson:"transactions committed"`
	CacheOverflowFailure float64 `bson:"transaction failures due to cache overflow"`
	RolledBack           float64 `bson:"transactions rolled back"`
}

transaction stats

func (*WTTransactionStats) Describe

func (stats *WTTransactionStats) Describe(ch chan<- *prometheus.Desc)

func (*WTTransactionStats) Export

func (stats *WTTransactionStats) Export(ch chan<- prometheus.Metric)

type WiredTigerStats

type WiredTigerStats struct {
	BlockManager           *WTBlockManagerStats           `bson:"block-manager"`
	Cache                  *WTCacheStats                  `bson:"cache"`
	Log                    *WTLogStats                    `bson:"log"`
	Session                *WTSessionStats                `bson:"session"`
	Transaction            *WTTransactionStats            `bson:"transaction"`
	ConcurrentTransactions *WTConcurrentTransactionsStats `bson:"concurrentTransactions"`
}

WiredTiger stats

func (*WiredTigerStats) Describe

func (stats *WiredTigerStats) Describe(ch chan<- *prometheus.Desc)

func (*WiredTigerStats) Export

func (stats *WiredTigerStats) Export(ch chan<- prometheus.Metric)

Jump to

Keyboard shortcuts

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