diff --git a/c++/src/io/OutputStream.cc b/c++/src/io/OutputStream.cc index 118a664716..ac5339c644 100644 --- a/c++/src/io/OutputStream.cc +++ b/c++/src/io/OutputStream.cc @@ -87,7 +87,7 @@ namespace orc { uint64_t dataSize = dataBuffer->size(); // flush data buffer into outputStream if (dataSize > 0) { - SCOPED_STOPWATCH(metrics, IOBlockingLatencyUs, nullptr); + SCOPED_STOPWATCH(metrics, IOBlockingLatencyUs, IOCount); dataBuffer->writeTo(outputStream, metrics); } dataBuffer->resize(0); diff --git a/c++/test/TestBufferedOutputStream.cc b/c++/test/TestBufferedOutputStream.cc index 4cb70007b4..6735ac43d3 100644 --- a/c++/test/TestBufferedOutputStream.cc +++ b/c++/test/TestBufferedOutputStream.cc @@ -46,7 +46,7 @@ namespace orc { EXPECT_EQ(memStream.getData()[i], 'a' + i % 10); } #if ENABLE_METRICS - EXPECT_EQ(metrics.IOCount.load(), 1); + EXPECT_EQ(metrics.IOCount.load(), 2); #endif } @@ -95,7 +95,7 @@ namespace orc { EXPECT_EQ(memStream.getData()[i + 7], 'a' + i); } #if ENABLE_METRICS - EXPECT_EQ(metrics.IOCount.load(), 2); + EXPECT_EQ(metrics.IOCount.load(), 4); #endif }