MCPcopy Create free account
hub / github.com/apple/foundationdb / customSystemMonitor

Function customSystemMonitor

flow/SystemMonitor.cpp:70–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 .detail("ActiveThreads" #size, FastAllocator<size>::getActiveThreads())
69
70SystemStatistics customSystemMonitor(std::string const& eventName, StatisticsState* statState, bool machineMetrics) {
71 const IPAddress ipAddr = machineState.ip.present() ? machineState.ip.get() : IPAddress();
72 SystemStatistics currentStats = getSystemStatistics(
73 machineState.folder.present() ? machineState.folder.get() : "", &ipAddr, &statState->systemState, true);
74 NetworkData netData;
75 netData.init();
76 if (!g_network->isSimulated() && currentStats.initialized) {
77 {
78 TraceEvent(eventName.c_str())
79 .detail("Elapsed", currentStats.elapsed)
80 .detail("CPUSeconds", currentStats.processCPUSeconds)
81 .detail("MainThreadCPUSeconds", currentStats.mainThreadCPUSeconds)
82 .detail("UptimeSeconds", now() - machineState.monitorStartTime)
83 .detail("Memory", currentStats.processMemory)
84 .detail("ResidentMemory", currentStats.processResidentMemory)
85 .detail("UnusedAllocatedMemory", getTotalUnusedAllocatedMemory())
86 .detail("MbpsSent",
87 ((netData.bytesSent - statState->networkState.bytesSent) * 8e-6) / currentStats.elapsed)
88 .detail("MbpsReceived",
89 ((netData.bytesReceived - statState->networkState.bytesReceived) * 8e-6) / currentStats.elapsed)
90 .detail("DiskTotalBytes", currentStats.processDiskTotalBytes)
91 .detail("DiskFreeBytes", currentStats.processDiskFreeBytes)
92 .detail("DiskQueueDepth", currentStats.processDiskQueueDepth)
93 .detail("DiskIdleSeconds", currentStats.processDiskIdleSeconds)
94 .detail("DiskReads", currentStats.processDiskRead)
95 .detail("DiskReadSeconds", currentStats.processDiskReadSeconds)
96 .detail("DiskWrites", currentStats.processDiskWrite)
97 .detail("DiskWriteSeconds", currentStats.processDiskWriteSeconds)
98 .detail("DiskReadsCount", currentStats.processDiskReadCount)
99 .detail("DiskWritesCount", currentStats.processDiskWriteCount)
100 .detail("DiskWriteSectors", currentStats.processDiskWriteSectors)
101 .detail("DiskReadSectors", currentStats.processDiskReadSectors)
102 .detail("FileWrites", netData.countFileLogicalWrites - statState->networkState.countFileLogicalWrites)
103 .detail("FileReads", netData.countFileLogicalReads - statState->networkState.countFileLogicalReads)
104 .detail("CacheReadBytes",
105 netData.countFileCacheReadBytes - statState->networkState.countFileCacheReadBytes)
106 .detail("CacheFinds", netData.countFileCacheFinds - statState->networkState.countFileCacheFinds)
107 .detail("CacheWritesBlocked",
108 netData.countFileCacheWritesBlocked - statState->networkState.countFileCacheWritesBlocked)
109 .detail("CacheReadsBlocked",
110 netData.countFileCacheReadsBlocked - statState->networkState.countFileCacheReadsBlocked)
111 .detail("CachePageReadsMerged",
112 netData.countFileCachePageReadsMerged - statState->networkState.countFileCachePageReadsMerged)
113 .detail("CacheWrites", netData.countFileCacheWrites - statState->networkState.countFileCacheWrites)
114 .detail("CacheReads", netData.countFileCacheReads - statState->networkState.countFileCacheReads)
115 .detail("CacheHits", netData.countFilePageCacheHits - statState->networkState.countFilePageCacheHits)
116 .detail("CacheMisses",
117 netData.countFilePageCacheMisses - statState->networkState.countFilePageCacheMisses)
118 .detail("CacheEvictions",
119 netData.countFilePageCacheEvictions - statState->networkState.countFilePageCacheEvictions)
120 .detail("DCID", machineState.dcId)
121 .detail("ZoneID", machineState.zoneId)
122 .detail("MachineID", machineState.machineId)
123 .detail("AIOSubmitCount", netData.countAIOSubmit - statState->networkState.countAIOSubmit)
124 .detail("AIOCollectCount", netData.countAIOCollect - statState->networkState.countAIOCollect)
125 .detail("AIOSubmitLag",
126 (g_network->networkInfo.metrics.secSquaredSubmit -
127 statState->networkMetricsState.secSquaredSubmit) /

Callers 4

systemMonitorFunction · 0.85
_startMethod · 0.85
_startMethod · 0.85
_startMethod · 0.85

Calls 15

TraceEventClass · 0.85
nowFunction · 0.85
format_backtraceFunction · 0.85
detailMethod · 0.80
substrMethod · 0.80
emplace_backMethod · 0.80
atMethod · 0.80
getSystemStatisticsFunction · 0.70
formatFunction · 0.70
getMethod · 0.65
IPAddressClass · 0.50

Tested by

no test coverage detected