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

Method ReadProcStatString

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

Source from the content-addressed store, hash-verified

118}
119
120void SystemStateInfo::ReadProcStatString(const string& stat_string) {
121 cpu_val_idx_ = 1 - cpu_val_idx_;
122 DCHECK(cpu_val_idx_ == 0 || cpu_val_idx_ == 1) << "cpu_val_idx_: " << cpu_val_idx_;
123 CpuValues& next_values = cpu_values_[cpu_val_idx_];
124
125 // Skip the first value ('cpu ');
126 StringPiece sp(stat_string);
127 DCHECK(sp.starts_with("cpu "));
128 ReadIntArray(sp.substr(5), NUM_CPU_VALUES, &next_values);
129}
130
131void SystemStateInfo::ComputeCpuRatios() {
132 const CpuValues& cur = cpu_values_[cpu_val_idx_];

Callers 1

TEST_FFunction · 0.80

Calls 3

ReadIntArrayFunction · 0.85
starts_withMethod · 0.80
substrMethod · 0.80

Tested by 1

TEST_FFunction · 0.64