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

Method ComputeDiskStats

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

Source from the content-addressed store, hash-verified

260}
261
262void SystemStateInfo::ComputeDiskStats(int64_t period_ms) {
263 if (period_ms <= 0) return;
264 // Compute disk throughput in bytes per second
265 const DiskValues& cur = disk_values_[disk_val_idx_];
266 const DiskValues& old = disk_values_[1 - disk_val_idx_];
267 int64_t read_sectors = cur[DISK_SECTORS_READ] - old[DISK_SECTORS_READ];
268 disk_stats_.read_rate.Store(read_sectors * BYTES_PER_SECTOR * 1000 / period_ms);
269
270 int64_t write_sectors = cur[DISK_SECTORS_WRITTEN] - old[DISK_SECTORS_WRITTEN];
271 disk_stats_.write_rate.Store(write_sectors * BYTES_PER_SECTOR * 1000 / period_ms);
272}
273
274} // namespace impala

Callers 1

TEST_FFunction · 0.80

Calls 1

StoreMethod · 0.45

Tested by 1

TEST_FFunction · 0.64