-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] Fix load profile miss metrics "IndexNum" "ReplicatedStorage"…
… "TxnID" (#46074) Signed-off-by: PengFei Li <[email protected]>
- Loading branch information
Showing
3 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
-- name: test_load_profile | ||
CREATE TABLE `t0` ( | ||
`v1` int(11) NOT NULL, | ||
`v2` int(11) NOT NULL, | ||
`v3` int(11) NOT NULL | ||
) ENGINE=OLAP | ||
DUPLICATE KEY(`v1`) | ||
DISTRIBUTED BY HASH(`v1`) BUCKETS 10 | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
-- result: | ||
-- !result | ||
SET enable_profile="true"; | ||
-- result: | ||
-- !result | ||
INSERT INTO `t0` (v1, v2, v3) values | ||
(1, 1, 1), | ||
(1, 1, 2), | ||
(1, 1, 3), | ||
(1, 2, 4), | ||
(1, 2, 5), | ||
(1, 2, 6), | ||
(2, 3, 7), | ||
(2, 3, 8), | ||
(2, 3, 9), | ||
(2, 4, 10), | ||
(2, 4, 11), | ||
(2, 4, 12); | ||
-- result: | ||
-- !result | ||
with | ||
profile as ( | ||
select unnest as line from (values(1))t(v) join unnest(split(get_query_profile(last_query_id()), "\n") ) | ||
), result as ( | ||
select * from profile | ||
where REGEXP(line, "- (RowsRead|RowsReturned|RowsFiltered|OpenTime|CloseWaitTime|PrepareDataTime)") | ||
OR REGEXP(line, "- (ConvertChunkTime|ValidateDataTime|SendDataTime|PackChunkTime|SendRpcTime)") | ||
OR REGEXP(line, "- (WaitResponseTime|SerializeChunkTime|CompressTime|RpcClientSideTime|RpcServerSideTime)") | ||
OR REGEXP(line, "- (RpcServerWaitFlushTime|TxnID|IndexNum|ReplicatedStorage|AllocAutoIncrementTime)") | ||
OR REGEXP(line, "- (AutomaticPartition)") | ||
) | ||
select count(*) from result; | ||
-- result: | ||
22 | ||
-- !result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
-- name: test_load_profile | ||
CREATE TABLE `t0` ( | ||
`v1` int(11) NOT NULL, | ||
`v2` int(11) NOT NULL, | ||
`v3` int(11) NOT NULL | ||
) ENGINE=OLAP | ||
DUPLICATE KEY(`v1`) | ||
DISTRIBUTED BY HASH(`v1`) BUCKETS 10 | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); | ||
|
||
SET enable_profile="true"; | ||
|
||
INSERT INTO `t0` (v1, v2, v3) values | ||
(1, 1, 1), | ||
(1, 1, 2), | ||
(1, 1, 3), | ||
(1, 2, 4), | ||
(1, 2, 5), | ||
(1, 2, 6), | ||
(2, 3, 7), | ||
(2, 3, 8), | ||
(2, 3, 9), | ||
(2, 4, 10), | ||
(2, 4, 11), | ||
(2, 4, 12); | ||
|
||
with | ||
profile as ( | ||
select unnest as line from (values(1))t(v) join unnest(split(get_query_profile(last_query_id()), "\n") ) | ||
), result as ( | ||
select * from profile | ||
where REGEXP(line, "- (RowsRead|RowsReturned|RowsFiltered|OpenTime|CloseWaitTime|PrepareDataTime)") | ||
OR REGEXP(line, "- (ConvertChunkTime|ValidateDataTime|SendDataTime|PackChunkTime|SendRpcTime)") | ||
OR REGEXP(line, "- (WaitResponseTime|SerializeChunkTime|CompressTime|RpcClientSideTime|RpcServerSideTime)") | ||
OR REGEXP(line, "- (RpcServerWaitFlushTime|TxnID|IndexNum|ReplicatedStorage|AllocAutoIncrementTime)") | ||
OR REGEXP(line, "- (AutomaticPartition)") | ||
) | ||
select count(*) from result; |