Beispiel #1
0
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)
}
Beispiel #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)
}
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)
}
Beispiel #4
0
// 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")

}
Beispiel #5
0
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)
}
Beispiel #6
0
// 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)
}
Beispiel #7
0
// 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)
}
Beispiel #8
0
// 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")
}
Beispiel #9
0
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)
}
Beispiel #10
0
// 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)
}
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()))
}
Beispiel #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")
}
Beispiel #13
0
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)
}
Beispiel #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)
}
Beispiel #15
0
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)
	}
}
// 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")
	}
}
Beispiel #17
0
// 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)
}
Beispiel #18
0
// 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")
}
Beispiel #19
0
// 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")
}
Beispiel #20
0
func (queueStats *QueueStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("reader", queueStats.Readers)
	group.Export("writer", queueStats.Writers)
}
Beispiel #21
0
func (clientStats *ClientStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("reader", clientStats.Readers)
	group.Export("writer", clientStats.Writers)
}
Beispiel #22
0
// 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)
}
Beispiel #23
0
// 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)
}
Beispiel #24
0
func (extraInfo *ExtraInfo) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("heap_usage_bytes", extraInfo.HeapUsageBytes)
	group.Export("page_faults_total", extraInfo.PageFaults)
}
Beispiel #25
0
// 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)
}
Beispiel #26
0
// Export exposes the record stats.
func (recordStats *RecordStats) Export(groupName string) {
	group := shared.FindOrCreateGroup(groupName)
	group.Export("moves_total", recordStats.Moves)
}