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 (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) }
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) }
// 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") }
// 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) }
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) }
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) }
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") }
// 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) }
// 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") }
// 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) }
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())) }
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) }
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) }
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) } }
func (extraInfo *ExtraInfo) Export(groupName string) { group := shared.FindOrCreateGroup(groupName) group.Export("heap_usage_bytes", extraInfo.HeapUsageBytes) group.Export("page_faults_total", extraInfo.PageFaults) }
// 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") }
// Export exposes the record stats. func (recordStats *RecordStats) Export(groupName string) { group := shared.FindOrCreateGroup(groupName) group.Export("moves_total", recordStats.Moves) }
// 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) }
// 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") } }
// 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") }
// 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) }
func (queueStats *QueueStats) Export(groupName string) { group := shared.FindOrCreateGroup(groupName) group.Export("reader", queueStats.Readers) group.Export("writer", queueStats.Writers) }
func (clientStats *ClientStats) Export(groupName string) { group := shared.FindOrCreateGroup(groupName) group.Export("reader", clientStats.Readers) group.Export("writer", clientStats.Writers) }
// 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) }
// 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) }