fix incorrect metric: StorageBufferBytes

This commit is contained in:
Yatian Xu 2021-12-24 17:49:59 -08:00
parent 20c0599751
commit 565a38a2e3

View File

@ -455,10 +455,8 @@ static void appendBlock(const Block & from, Block & to)
size_t rows = from.rows();
size_t bytes = from.bytes();
CurrentMetrics::add(CurrentMetrics::StorageBufferRows, rows);
CurrentMetrics::add(CurrentMetrics::StorageBufferBytes, bytes);
size_t old_rows = to.rows();
size_t old_bytes = to.bytes();
MutableColumnPtr last_col;
try
@ -468,6 +466,8 @@ static void appendBlock(const Block & from, Block & to)
if (to.rows() == 0)
{
to = from;
CurrentMetrics::add(CurrentMetrics::StorageBufferRows, rows);
CurrentMetrics::add(CurrentMetrics::StorageBufferBytes, bytes);
}
else
{
@ -480,6 +480,8 @@ static void appendBlock(const Block & from, Block & to)
to.getByPosition(column_no).column = std::move(last_col);
}
CurrentMetrics::add(CurrentMetrics::StorageBufferRows, rows);
CurrentMetrics::add(CurrentMetrics::StorageBufferBytes, to.bytes() - old_bytes);
}
}
catch (...)