Documentation ¶
Index ¶
- type ApplyStats
- type AssertsStats
- type BenchmarkStats
- type BufferStats
- type ClientStats
- type ConnectionStats
- type Cursors
- type DocumentStats
- type DurStats
- type DurTiming
- type ExtraInfo
- type FlushStats
- type GetLastErrorStats
- type GlobalLockStats
- type IndexCounterStats
- type LockStats
- type LockStatsMap
- type MemStats
- type MetricsNetworkStats
- type MetricsStats
- type MongodbCollector
- type MongodbCollectorOpts
- type NetworkStats
- type OpcountersStats
- type OperationStats
- type PreloadStats
- type QueryExecutorStats
- type QueueStats
- type ReadWriteLockTimes
- type RecordStats
- type ReplStats
- type ServerStatus
- type StorageStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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(groupName string)
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"` }
func (*AssertsStats) Export ¶
func (asserts *AssertsStats) Export(groupName string)
type BenchmarkStats ¶
BenchmarkStats is bechmark info about an operation.
func (*BenchmarkStats) Export ¶
func (benchmarkStats *BenchmarkStats) Export(groupName string)
Export exports the benchmark stats.
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(groupName string)
Export exports the buffer stats.
type ClientStats ¶
type ClientStats struct { Total float64 `bson:"total"` Readers float64 `bson:"readers"` Writers float64 `bson:"writers"` }
GlobalLock
func (*ClientStats) Export ¶
func (clientStats *ClientStats) Export(groupName string)
type ConnectionStats ¶
type ConnectionStats struct { Current float64 `bson:"current"` Available float64 `bson:"available"` TotalCreated float64 `bson:"totalCreated"` }
Connection
func (*ConnectionStats) Export ¶
func (connectionStats *ConnectionStats) Export(groupName string)
type Cursors ¶
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(groupName string)
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.
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.
type ExtraInfo ¶
type ExtraInfo struct { HeapUsageBytes float64 `bson:"heap_usage_bytes"` PageFaults float64 `bson:"page_faults"` }
ExtraInfo
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"` }
Flush
func (*FlushStats) Export ¶
func (flushStats *FlushStats) Export(groupName string)
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(groupName string)
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"` }
func (*GlobalLockStats) Export ¶
func (globalLock *GlobalLockStats) Export(groupName string)
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"` }
IndexCounter
func (*IndexCounterStats) Export ¶
func (indexCountersStats *IndexCounterStats) Export(groupName string)
type LockStats ¶
type LockStats struct { TimeLockedMicros ReadWriteLockTimes `bson:"timeLockedMicros"` TimeAcquiringMicros ReadWriteLockTimes `bson:"timeAcquiringMicros"` }
type LockStatsMap ¶
func (LockStatsMap) Export ¶
func (locks LockStatsMap) Export(groupName string)
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"` }
Mem
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(groupName string)
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"` }
MetricsStats are all stats associated with metrics of the system
func (*MetricsStats) Export ¶
func (metricsStats *MetricsStats) Export(groupName string)
Export exports the metrics stats.
type MongodbCollector ¶
type MongodbCollector struct {
Opts MongodbCollectorOpts
}
func NewMongodbCollector ¶
func NewMongodbCollector(opts MongodbCollectorOpts) *MongodbCollector
func (*MongodbCollector) Collect ¶
func (exporter *MongodbCollector) Collect(ch chan<- prometheus.Metric)
func (*MongodbCollector) Describe ¶
func (exporter *MongodbCollector) Describe(ch chan<- *prometheus.Desc)
type MongodbCollectorOpts ¶
type MongodbCollectorOpts struct {
URI string
}
type NetworkStats ¶
type NetworkStats struct { BytesIn float64 `bson:"bytesIn"` BytesOut float64 `bson:"bytesOut"` NumRequests float64 `bson:"numRequests"` }
Network
func (*NetworkStats) Export ¶
func (networkStats *NetworkStats) Export(groupName string)
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"` }
Opcount and OpcountersRepl
func (*OpcountersStats) Export ¶
func (opCounters *OpcountersStats) Export(groupName string)
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(groupName string)
Export exports the operation stats.
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(groupName string)
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(groupName string)
Export exports the query executor stats.
type QueueStats ¶
type QueueStats struct { Total float64 `bson:"total"` Readers float64 `bson:"readers"` Writers float64 `bson:"writers"` }
func (*QueueStats) Export ¶
func (queueStats *QueueStats) Export(groupName string)
type ReadWriteLockTimes ¶
type ReadWriteLockTimes struct { Read float64 `bson:"R"` Write float64 `bson:"W"` ReadLower float64 `bson:"r"` WriteLower float64 `bson:"w"` }
Lock
type RecordStats ¶
type RecordStats struct {
Moves float64 `bson:"moves"`
}
RecordStats are stats associated with a record.
func (*RecordStats) Export ¶
func (recordStats *RecordStats) Export(groupName string)
Export exposes the record stats.
type ReplStats ¶
type ReplStats struct { Apply *ApplyStats `bson:"apply"` Buffer *BufferStats `bson:"buffer"` Network *MetricsNetworkStats `bson:"network"` PreloadStats *PreloadStats `bson:"preload"` }
ReplStats are the stats associated with the replication process.
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 *OpcountersStats `bson:"opcountersRepl"` Mem *MemStats `bson:"mem"` Metrics *MetricsStats `bson:"metrics"` Cursors *Cursors `bson:"cursors"` }
ServerStatus keeps the data returned by the serverStatus() method.
func GetServerStatus ¶
func GetServerStatus(uri string) *ServerStatus
GetServerStatus returns the server status info.
func (*ServerStatus) Export ¶
func (status *ServerStatus) Export(groupName string)
Export exports the given groupName to be consumed by 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(groupName string)
Export exports the storage stats.