提交 259be751 编写于 作者: M millb

Fixed metric name.

Add metric description.
Add test.
上级 4e893eb9
......@@ -114,7 +114,7 @@
M(SelectedRanges, "Number of (non-adjacent) ranges in all data parts selected to read from a MergeTree table.") \
M(SelectedMarks, "Number of marks (index granules) selected to read from a MergeTree table.") \
\
M(CountOfMerges, "") \
M(Merge, "Number of launches background merges.") \
M(MergedRows, "Rows read for background merges. This is the number of rows before merge.") \
M(MergedUncompressedBytes, "Uncompressed bytes (for columns as they stored in memory) that was read for background merges. This is the number before merge.") \
M(MergesTimeMilliseconds, "Total time spent for background merges.")\
......
......@@ -39,7 +39,7 @@ namespace ProfileEvents
extern const Event MergedRows;
extern const Event MergedUncompressedBytes;
extern const Event MergesTimeMilliseconds;
extern const Event CountOfMerges;
extern const Event Merge;
}
namespace CurrentMetrics
......@@ -511,7 +511,7 @@ public:
if (stage.is_first)
{
ProfileEvents::increment(ProfileEvents::MergedRows, value.read_rows);
ProfileEvents::increment(ProfileEvents::CountOfMerges);
ProfileEvents::increment(ProfileEvents::Merge);
}
updateWatch();
......
DROP TABLE IF EXISTs new_table_test;
DROP TABLE IF EXISTS check_table_test;
CREATE TABLE IF NOT EXISTS new_table_test(name String) ENGINE = MergeTree Order By name;
CREATE TABLE IF NOT EXISTS check_table_test(value1 UInt64, value2 UInt64) ENGINE = MergeTree Order By tuple();
INSERT INTO check_table_test (value1) SELECT value from system.events WHERE event = 'Merge';
OPTIMIZE TABLE new_table_test FINAL;
INSERT INTO check_table_test (value2) SELECT value from system.events WHERE event = 'Merge';
SELECT count() FROM check_table_test WHERE value2 > value1;
DROP TABLE new_table_test;
DROP TABLE check_table_test;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册