Documentation ¶
Index ¶
- Variables
- func GetMongosInfo(session *mgo.Session) *[]MongosInfo
- func GetShards(session *mgo.Session) *[]ShardingTopoShardInfo
- func GetTotalChunks(session *mgo.Session) float64
- func GetTotalChunksByShard(session *mgo.Session) *[]ShardingTopoChunkInfo
- func GetTotalDatabases(session *mgo.Session) *[]ShardingTopoStatsTotalDatabases
- func GetTotalShardedCollections(session *mgo.Session) float64
- func IsBalancerEnabled(session *mgo.Session) float64
- func IsClusterBalanced(session *mgo.Session) float64
- type AssertsStats
- type BenchmarkStats
- type ConnectionStats
- type CursorStats
- type CursorStatsOpen
- type Cursors
- type ExtraInfo
- type GetLastErrorStats
- type MemStats
- type MetricsStats
- type MongosBalancerLock
- type MongosInfo
- type NetworkStats
- type OpcountersReplStats
- type OpcountersStats
- type ServerStatus
- type ShardingChangelogStats
- type ShardingChangelogSummary
- type ShardingChangelogSummaryId
- type ShardingStats
- type ShardingTopoChunkInfo
- type ShardingTopoShardInfo
- type ShardingTopoStats
- type ShardingTopoStatsTotalDatabases
Constants ¶
This section is empty.
Variables ¶
var (
// Namespace is the namespace of the metrics
Namespace = "mongodb_mongos"
)
Functions ¶
func GetMongosInfo ¶
func GetMongosInfo(session *mgo.Session) *[]MongosInfo
func GetShards ¶
func GetShards(session *mgo.Session) *[]ShardingTopoShardInfo
func GetTotalChunks ¶
func GetTotalChunks(session *mgo.Session) float64
func GetTotalChunksByShard ¶
func GetTotalChunksByShard(session *mgo.Session) *[]ShardingTopoChunkInfo
func GetTotalDatabases ¶
func GetTotalDatabases(session *mgo.Session) *[]ShardingTopoStatsTotalDatabases
func GetTotalShardedCollections ¶
func GetTotalShardedCollections(session *mgo.Session) float64
func IsBalancerEnabled ¶
func IsBalancerEnabled(session *mgo.Session) float64
func IsClusterBalanced ¶
func IsClusterBalanced(session *mgo.Session) float64
Types ¶
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 ¶
BenchmarkStats is bechmark info about an operation.
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 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 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 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 MetricsStats ¶
type MetricsStats struct { GetLastError *GetLastErrorStats `bson:"getLastError"` 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 MongosBalancerLock ¶
type MongosBalancerLock struct { State float64 `bson:"state"` Process string `bson:"process"` Who string `bson:"who"` When time.Time `bson:"when"` Why string `bson:"why"` }
func GetMongosBalancerLock ¶
func GetMongosBalancerLock(session *mgo.Session) *MongosBalancerLock
type MongosInfo ¶
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 ServerStatus ¶
type ServerStatus struct { Uptime float64 `bson:"uptime"` UptimeEstimate float64 `bson:"uptimeEstimate"` LocalTime time.Time `bson:"localTime"` Asserts *AssertsStats `bson:"asserts"` Connections *ConnectionStats `bson:"connections"` ExtraInfo *ExtraInfo `bson:"extra_info"` Network *NetworkStats `bson:"network"` Opcounters *OpcountersStats `bson:"opcounters"` 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(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 ShardingChangelogStats ¶
type ShardingChangelogStats struct {
Items *[]ShardingChangelogSummary
}
func GetShardingChangelogStatus ¶
func GetShardingChangelogStatus(session *mgo.Session) *ShardingChangelogStats
func (*ShardingChangelogStats) Describe ¶
func (status *ShardingChangelogStats) Describe(ch chan<- *prometheus.Desc)
func (*ShardingChangelogStats) Export ¶
func (status *ShardingChangelogStats) Export(ch chan<- prometheus.Metric)
type ShardingChangelogSummary ¶
type ShardingChangelogSummary struct { Id *ShardingChangelogSummaryId `bson:"_id"` Count float64 `bson:"count"` }
type ShardingStats ¶
type ShardingStats struct { IsBalanced float64 BalancerEnabled float64 Changelog *ShardingChangelogStats Topology *ShardingTopoStats BalancerLock *MongosBalancerLock Mongos *[]MongosInfo }
func GetShardingStatus ¶
func GetShardingStatus(session *mgo.Session) *ShardingStats
func (*ShardingStats) Describe ¶
func (status *ShardingStats) Describe(ch chan<- *prometheus.Desc)
func (*ShardingStats) Export ¶
func (status *ShardingStats) Export(ch chan<- prometheus.Metric)
type ShardingTopoChunkInfo ¶
type ShardingTopoShardInfo ¶
type ShardingTopoStats ¶
type ShardingTopoStats struct { TotalChunks float64 TotalCollections float64 TotalDatabases *[]ShardingTopoStatsTotalDatabases Shards *[]ShardingTopoShardInfo ShardChunks *[]ShardingTopoChunkInfo }
func GetShardingTopoStatus ¶
func GetShardingTopoStatus(session *mgo.Session) *ShardingTopoStats
func (*ShardingTopoStats) Describe ¶
func (status *ShardingTopoStats) Describe(ch chan<- *prometheus.Desc)
func (*ShardingTopoStats) Export ¶
func (status *ShardingTopoStats) Export(ch chan<- prometheus.Metric)