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

Method ReadCurrentProcStat

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

Source from the content-addressed store, hash-verified

108}
109
110void SystemStateInfo::ReadCurrentProcStat() {
111 string path = "/proc/stat";
112 faststring buf;
113 if (!ReadFileOrWarn(path, &buf)) return;
114 StringPiece buf_sp(reinterpret_cast<const char*>(buf.data()), buf.size());
115 vector<StringPiece> lines = strings::Split(buf_sp, "\n");
116 DCHECK_GT(lines.size(), 0);
117 ReadProcStatString(lines[0].ToString());
118}
119
120void SystemStateInfo::ReadProcStatString(const string& stat_string) {
121 cpu_val_idx_ = 1 - cpu_val_idx_;

Callers 1

TEST_FFunction · 0.80

Calls 5

ReadFileOrWarnFunction · 0.85
SplitFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45
ToStringMethod · 0.45

Tested by 1

TEST_FFunction · 0.64