MCPcopy Create free account
hub / github.com/apache/impala / CaptureSystemStateSnapshot

Method CaptureSystemStateSnapshot

be/src/util/system-state-info.cc:92–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void SystemStateInfo::CaptureSystemStateSnapshot() {
93 // Capture and compute CPU usage
94 ReadCurrentProcStat();
95 ComputeCpuRatios();
96
97 int64_t now = MonotonicMillis();
98 ReadCurrentProcNetDev();
99 DCHECK_GT(last_net_update_ms_, 0L);
100 ComputeNetworkUsage(now - last_net_update_ms_);
101 last_net_update_ms_ = now;
102
103 now = MonotonicMillis();
104 ReadCurrentProcDiskStats();
105 DCHECK_GT(last_disk_update_ms_, 0L);
106 ComputeDiskStats(now - last_disk_update_ms_);
107 last_disk_update_ms_ = now;
108}
109
110void SystemStateInfo::ReadCurrentProcStat() {
111 string path = "/proc/stat";

Callers 2

InitSystemStateInfoMethod · 0.80
TEST_FFunction · 0.80

Calls 1

MonotonicMillisFunction · 0.85

Tested by 1

TEST_FFunction · 0.64