Commit 7e1c3077 authored by Ilya Prokhorov's avatar Ilya Prokhorov

Check if all bytes read

parent 60965cbf
......@@ -24,7 +24,7 @@ int main() {
auto bytesBlockSize = 1024;
auto mgBlocksSize = bytesBlockSize * 1024;
auto mgbsPerBlock = 260;
auto mgbsPerBlock = 520;
auto blockSize = mgBlocksSize * mgbsPerBlock;
auto buffer = new char[blockSize];
......@@ -37,11 +37,16 @@ int main() {
}
auto end = std::chrono::steady_clock::now();
if (inputStream.gcount() != blockSize) {
auto currentGB = position / 1024 / 1024 / 1000;
cout << "Can't read at " << currentGB << "GB, bad block?" << endl;
}
auto readTime = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
if (readTime > 2100) {
auto currentMB = position / 1024 / 1024;
cout << "slow block at " << currentMB << endl;
if (readTime > 4200) {
auto currentGB = position / 1024 / 1024 / 1000;
cout << "slow block at " << currentGB << "GB" << endl;
cout << "T: " << fixed << readTime << setprecision(5);
cout << "s" << endl;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment