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

Method ReadProcDiskStatsLine

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

Source from the content-addressed store, hash-verified

240}
241
242void SystemStateInfo::ReadProcDiskStatsLine(
243 const string& disk_stats, DiskValues* result) {
244 stringstream ss(disk_stats);
245
246 // Read the device IDs and name
247 string major, minor, disk_name;
248 ss >> major >> minor >> disk_name;
249
250 if (!DiskInfo::is_known_disk(disk_name)) {
251 memset(result, 0, sizeof(*result));
252 return;
253 }
254
255 ReadIntArray(StringPiece(disk_stats).substr(ss.tellg()), NUM_DISK_VALUES, result);
256}
257
258void SystemStateInfo::AddDiskValues(const DiskValues& a, DiskValues* b) {
259 for (int i = 0; i < NUM_DISK_VALUES; ++i) (*b)[i] += a[i];

Callers

nothing calls this directly

Calls 3

ReadIntArrayFunction · 0.85
substrMethod · 0.80
StringPieceClass · 0.70

Tested by

no test coverage detected