コード例 #1
0
ファイル: network.go プロジェクト: lowstz/mongodb_exporter
func (networkStats *NetworkStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName + "_bytes_total")
	group.Export("in_bytes", networkStats.BytesIn)
	group.Export("out_bytes", networkStats.BytesOut)

	group = shared.FindOrCreateGroup(groupName + "_metrics")
	group.Export("num_requests_total", networkStats.NumRequests)
}
コード例 #2
0
func (connectionStats *ConnectionStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("current", connectionStats.Current)
	group.Export("available", connectionStats.Available)

	group = shared.FindOrCreateGroup(groupName + "_metrics")
	group.Export("created_total", connectionStats.TotalCreated)
}
コード例 #3
0
func (indexCountersStats *IndexCounterStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName + "_total")
	group.Export("accesses", indexCountersStats.Accesses)
	group.Export("hits", indexCountersStats.Hits)
	group.Export("misses", indexCountersStats.Misses)
	group.Export("resets", indexCountersStats.Resets)

	group = shared.FindOrCreateGroup(groupName)
	group.Export("miss_ratio", indexCountersStats.MissRatio)
}
コード例 #4
0
ファイル: durability.go プロジェクト: lowstz/mongodb_exporter
// Export export the durability stats for the prometheus server.
func (durStats *DurStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName + "_commits")
	group.Export("written", durStats.Commits)
	group.Export("in_write_lock", durStats.CommitsInWriteLock)

	group = shared.FindOrCreateGroup(groupName)
	group.Export("journaled_megabytes", durStats.JournaledMB)
	group.Export("write_to_data_files_megabytes", durStats.WriteToDataFilesMB)
	group.Export("compression", durStats.Compression)
	group.Export("early_commits", durStats.EarlyCommits)

	durStats.TimeMs.Export(groupName + "_time_milliseconds")

}
コード例 #5
0
ファイル: memory.go プロジェクト: lowstz/mongodb_exporter
func (memStats *MemStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("resident", memStats.Resident)
	group.Export("virtual", memStats.Virtual)
	group.Export("mapped", memStats.Mapped)
	group.Export("mapped_with_journal", memStats.MappedWithJournal)
}
コード例 #6
0
ファイル: metrics.go プロジェクト: lowstz/mongodb_exporter
// Export exports the storage stats.
func (storageStats *StorageStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)

	group.Export("bucket_exhausted", storageStats.BucketExhausted)
	group.Export("requests", storageStats.Requests)
	group.Export("scanned", storageStats.Scanned)
}
コード例 #7
0
ファイル: metrics.go プロジェクト: lowstz/mongodb_exporter
// Export exposes the document stats to be consumed by the prometheus server.
func (documentStats *DocumentStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)

	group.Export("deleted", documentStats.Deleted)
	group.Export("inserted", documentStats.Inserted)
	group.Export("returned", documentStats.Returned)
	group.Export("updated", documentStats.Updated)
}
コード例 #8
0
ファイル: metrics.go プロジェクト: lowstz/mongodb_exporter
// Export exposes the network stats.
func (metricsNetworkStats *MetricsNetworkStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("bytes_total", metricsNetworkStats.Bytes)
	group.Export("ops_total", metricsNetworkStats.Ops)
	group.Export("readers_created_total", metricsNetworkStats.ReadersCreated)

	metricsNetworkStats.GetMores.Export(groupName + "_getmores")
}
コード例 #9
0
ファイル: cursors.go プロジェクト: lowstz/mongodb_exporter
func (cursors *Cursors) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)

	group.Export("total_open", cursors.TotalOpen)
	group.Export("timed_out", cursors.TimeOut)
	group.Export("total_no_timeout", cursors.TotalNoTimeout)
	group.Export("pinned", cursors.Pinned)
}
コード例 #10
0
ファイル: durability.go プロジェクト: lowstz/mongodb_exporter
// Export exports the data for the prometheus server.
func (durTiming *DurTiming) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("dt", durTiming.Dt)
	group.Export("prep_log_buffer", durTiming.PrepLogBuffer)
	group.Export("write_to_journal", durTiming.WriteToJournal)
	group.Export("write_to_data_files", durTiming.WriteToDataFiles)
	group.Export("remap_private_view", durTiming.RemapPrivateView)
}
コード例 #11
0
func (flushStats *FlushStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("flushes_total", flushStats.Flushes)
	group.Export("total_milliseconds", flushStats.TotalMs)
	group.Export("average_milliseconds", flushStats.AverageMs)
	group.Export("last_milliseconds", flushStats.LastMs)
	group.Export("last_finished_time", float64(flushStats.LastFinished.Unix()))
}
コード例 #12
0
func (globalLock *GlobalLockStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("lock_total", globalLock.LockTime)
	group.Export("ratio", globalLock.Ratio)

	globalLock.CurrentQueue.Export(groupName + "_current_queue")
	globalLock.ActiveClients.Export(groupName + "_client")
}
コード例 #13
0
ファイル: asserts.go プロジェクト: lowstz/mongodb_exporter
func (asserts *AssertsStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName + "_total")

	group.Export("regular", asserts.Regular)
	group.Export("warning", asserts.Warning)
	group.Export("msg", asserts.Msg)
	group.Export("user", asserts.User)
	group.Export("rollovers", asserts.Rollovers)
}
コード例 #14
0
func (opCounters *OpcountersStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName + "_total")
	group.Export("insert", opCounters.Insert)
	group.Export("query", opCounters.Query)
	group.Export("update", opCounters.Update)
	group.Export("delete", opCounters.Delete)
	group.Export("getmore", opCounters.GetMore)
	group.Export("command", opCounters.Command)
}
コード例 #15
0
ファイル: locks.go プロジェクト: lowstz/mongodb_exporter
func (locks LockStatsMap) Export(groupName string) {
	for key, locks := range locks {
		if key == "." {
			key = "dot"
		}

		timeLockedGroup := shared.FindOrCreateGroup("locks_time_locked_microseconds_global")
		timeLockedGroup.DescName = "locks_time_locked_global_microseconds_total"
		timeLockedGroup.ExportWithLabels([]string{"read", key}, locks.TimeLockedMicros.Read)
		timeLockedGroup.ExportWithLabels([]string{"write", key}, locks.TimeLockedMicros.Write)

		timeLockedGroup = shared.FindOrCreateGroup("locks_time_locked_microseconds_local")
		timeLockedGroup.DescName = "locks_time_locked_local_microseconds_total"
		timeLockedGroup.ExportWithLabels([]string{"read", key}, locks.TimeLockedMicros.ReadLower)
		timeLockedGroup.ExportWithLabels([]string{"write", key}, locks.TimeLockedMicros.WriteLower)

		timeAcquiringGroup := shared.FindOrCreateGroup("locks_time_acquiring_microseconds_global")
		timeAcquiringGroup.DescName = "locks_time_acquiring_global_microseconds_total"
		timeAcquiringGroup.ExportWithLabels([]string{"read", key}, locks.TimeLockedMicros.Read)
		timeAcquiringGroup.ExportWithLabels([]string{"write", key}, locks.TimeLockedMicros.Write)
	}
}
コード例 #16
0
// Export exports the given groupName to be consumed by prometheus.
func (status *ServerStatus) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)

	group.Export("uptime_seconds", status.Uptime)
	group.Export("uptime_estimate_seconds", status.Uptime)
	group.Export("local_time", float64(status.LocalTime.Unix()))

	if status.Asserts != nil {
		exportData(status.Asserts, "asserts")
	}

	if status.Dur != nil {
		exportData(status.Dur, "durability")
	}

	if status.BackgroundFlushing != nil {
		exportData(status.BackgroundFlushing, "background_flushing")
	}

	if status.Connections != nil {
		exportData(status.Connections, "connections")
	}

	if status.ExtraInfo != nil {
		exportData(status.ExtraInfo, "extra_info")
	}

	if status.GlobalLock != nil {
		exportData(status.GlobalLock, "global_lock")
	}

	if status.IndexCounter != nil {
		exportData(status.IndexCounter, "index_counters")
	}

	if status.Network != nil {
		exportData(status.Network, "network")
	}

	if status.Opcounters != nil {
		exportData(status.Opcounters, "op_counters")
	}

	if status.OpcountersRepl != nil {
		exportData(status.OpcountersRepl, "op_counters_repl")
	}

	if status.Mem != nil {
		exportData(status.Mem, "memory")
	}

	if status.Locks != nil {
		exportData(status.Locks, "locks")
	}

	if status.Metrics != nil {
		exportData(status.Metrics, "metrics")
	}

	if status.Cursors != nil {
		exportData(status.Cursors, "cursors")
	}
}
コード例 #17
0
ファイル: metrics.go プロジェクト: lowstz/mongodb_exporter
// Export exports the benchmark stats.
func (benchmarkStats *BenchmarkStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)

	group.Export("num_total", benchmarkStats.Num)
	group.Export("total_milliseconds", benchmarkStats.TotalMillis)
}
コード例 #18
0
ファイル: metrics.go プロジェクト: lowstz/mongodb_exporter
// Export exposes the get last error stats.
func (getLastErrorStats *GetLastErrorStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)

	group.Export("wtimeouts_total", getLastErrorStats.Wtimeouts)
	getLastErrorStats.Wtime.Export(groupName + "_wtime")
}
コード例 #19
0
ファイル: metrics.go プロジェクト: lowstz/mongodb_exporter
// Export exports the apply stats
func (applyStats *ApplyStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("ops_total", applyStats.Ops)

	applyStats.Batches.Export(groupName + "_batches")
}
コード例 #20
0
func (queueStats *QueueStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("reader", queueStats.Readers)
	group.Export("writer", queueStats.Writers)
}
コード例 #21
0
func (clientStats *ClientStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("reader", clientStats.Readers)
	group.Export("writer", clientStats.Writers)
}
コード例 #22
0
ファイル: metrics.go プロジェクト: lowstz/mongodb_exporter
// Export exports the buffer stats.
func (bufferStats *BufferStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("count", bufferStats.Count)
	group.Export("max_size_bytes", bufferStats.MaxSizeBytes)
	group.Export("size_bytes", bufferStats.SizeBytes)
}
コード例 #23
0
ファイル: metrics.go プロジェクト: lowstz/mongodb_exporter
// Export exports the query executor stats.
func (queryExecutorStats *QueryExecutorStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("scanned", queryExecutorStats.Scanned)
	group.Export("scanned_objects", queryExecutorStats.ScannedObjects)
}
コード例 #24
0
ファイル: extra_info.go プロジェクト: lowstz/mongodb_exporter
func (extraInfo *ExtraInfo) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("heap_usage_bytes", extraInfo.HeapUsageBytes)
	group.Export("page_faults_total", extraInfo.PageFaults)
}
コード例 #25
0
ファイル: metrics.go プロジェクト: lowstz/mongodb_exporter
// Export exports the operation stats.
func (operationStats *OperationStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("fastmod", operationStats.Fastmod)
	group.Export("idhack", operationStats.Idhack)
	group.Export("scan_and_order", operationStats.ScanAndOrder)
}
コード例 #26
0
ファイル: metrics.go プロジェクト: lowstz/mongodb_exporter
// Export exposes the record stats.
func (recordStats *RecordStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("moves_total", recordStats.Moves)
}