Documentation
¶
Index ¶
- Variables
- func CollFullName(dbName, collName string) string
- func IsSystemCollection(collName string) bool
- func IsSystemDB(dbName string) bool
- type AssertsStats
- type ConnPoolStats
- type ConnectionStats
- type Cursors
- type DetailedTCMallocStats
- type ExtraInfo
- type GenericTCMAllocStats
- type MemStats
- type NetworkStats
- type OpcountersReplStats
- type OpcountersStats
- type ServerStatus
- type TCMallocStats
Constants ¶
This section is empty.
Variables ¶
var (
// Namespace is the namespace of the metrics
Namespace = "mongodb"
)
Functions ¶
func CollFullName ¶ added in v0.11.0
CollFullName returns collections full name.
func IsSystemCollection ¶ added in v0.11.0
IsSystemCollection tests whether system collection name passed.
func IsSystemDB ¶ added in v0.11.0
IsSystemDB tests whether system db name passed.
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 ConnPoolStats ¶ added in v0.9.0
type ConnPoolStats struct {
SyncClientConnections float64 `bson:"numClientConnections"`
ASScopedConnections float64 `bson:"numAScopedConnections"`
TotalInUse float64 `bson:"totalInUse"`
TotalAvailable float64 `bson:"totalAvailable"`
TotalCreated float64 `bson:"totalCreated"`
Ok float64 `bson:"ok"`
}
ConnPoolStats keeps the data returned by the connPoolStats command.
func GetConnPoolStats ¶ added in v0.9.0
func GetConnPoolStats(client *mongo.Client) *ConnPoolStats
GetConnPoolStats returns the server connPoolStats info.
func (*ConnPoolStats) Describe ¶ added in v0.9.0
func (stats *ConnPoolStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the server status for prometheus.
func (*ConnPoolStats) Export ¶ added in v0.9.0
func (stats *ConnPoolStats) Export(ch chan<- prometheus.Metric)
Export exports the server status to be consumed by prometheus.
type ConnectionStats ¶
type ConnectionStats struct {
Current float64 `bson:"current"`
Available float64 `bson:"available"`
TotalCreated float64 `bson:"totalCreated"`
Active *float64 `bson:"active,omitempty"`
}
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 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 DetailedTCMallocStats ¶ added in v0.9.0
type DetailedTCMallocStats struct {
PageheapFreeBytes float64 `bson:"pageheap_free_bytes"`
PageheapUnmappedBytes float64 `bson:"pageheap_unmapped_bytes"`
PageheapComittedBytes float64 `bson:"pageheap_committed_bytes"`
PageheapScavengeCount float64 `bson:"pageheap_scavenge_count"`
PageheapCommitCount float64 `bson:"pageheap_commit_count"`
PageheapTotalCommitBytes float64 `bson:"pageheap_total_commit_bytes"`
PageheapDecommitCount float64 `bson:"pageheap_decommit_count"`
PageheapTotalDecommitBytes float64 `bson:"pageheap_total_decommit_bytes"`
PageheapReserveCount float64 `bson:"pageheap_reserve_count"`
PageheapTotalReserveBytes float64 `bson:"pageheap_total_reserve_bytes"`
MaxTotalThreadCacheBytes float64 `bson:"max_total_thread_cache_bytes"`
CurrentTotalThreadCacheBytes float64 `bson:"current_total_thread_cache_bytes"`
CentralCacheFreeBytes float64 `bson:"central_cache_free_bytes"`
TransferCacheFreeBytes float64 `bson:"transfer_cache_free_bytes"`
ThreadCacheFreeBytes float64 `bson:"thread_cache_free_bytes"`
TotalFreeBytes float64 `bson:"total_free_bytes"`
AggressiveMemoryDecommit float64 `bson:"aggressive_memory_decommit"`
}
DetailedTCMallocStats tracks the mem stats detailed metrics.
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 GenericTCMAllocStats ¶ added in v0.9.0
type GenericTCMAllocStats struct {
CurrentAllocatedBytes float64 `bson:"current_allocated_bytes"`
HeapSize float64 `bson:"heap_size"`
}
GenericTCMAllocStats tracks the mem stats generic metrics.
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 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 ¶ added in v0.8.0
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 ¶ added in v0.8.0
func (opCounters *OpcountersReplStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*OpcountersReplStats) Export ¶ added in v0.8.0
func (opCounters *OpcountersReplStats) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type OpcountersStats ¶ added in v0.8.0
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 ¶ added in v0.8.0
func (opCounters *OpcountersStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*OpcountersStats) Export ¶ added in v0.8.0
func (opCounters *OpcountersStats) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type ServerStatus ¶
type ServerStatus struct {
Version string `bson:"version"`
Uptime float64 `bson:"uptime"`
UptimeEstimate float64 `bson:"uptimeEstimate"`
LocalTime time.Time `bson:"localTime"`
Asserts *AssertsStats `bson:"asserts"`
Connections *ConnectionStats `bson:"connections"`
Cursors *Cursors `bson:"cursors"`
ExtraInfo *ExtraInfo `bson:"extra_info"`
Mem *MemStats `bson:"mem"`
Network *NetworkStats `bson:"network"`
Opcounters *OpcountersStats `bson:"opcounters"`
OpcountersRepl *OpcountersReplStats `bson:"opcountersRepl"`
TCMallocStats *TCMallocStats `bson:"tcmalloc"`
}
ServerStatus keeps the data returned by the serverStatus() method.
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 TCMallocStats ¶ added in v0.9.0
type TCMallocStats struct {
Generic GenericTCMAllocStats `bson:"generic"`
Details DetailedTCMallocStats `bson:"tcmalloc"`
}
TCMallocStats tracks the mem stats metrics.
func (*TCMallocStats) Describe ¶ added in v0.9.0
func (m *TCMallocStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*TCMallocStats) Export ¶ added in v0.9.0
func (m *TCMallocStats) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.