Skip to content

Commit 84af0f1

Browse files
xiaochaoren1SongZhen0704
authored andcommitted
feat: querier add table file_event_metrics
1 parent 2c8b908 commit 84af0f1

30 files changed

Lines changed: 274 additions & 27 deletions

server/controller/db/metadb/migrator/schema/const.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ const (
2020
RAW_SQL_ROOT_DIR = "/etc/metadb/schema/rawsql"
2121

2222
DB_VERSION_TABLE = "db_version"
23-
DB_VERSION_EXPECTED = "7.1.0.3"
23+
DB_VERSION_EXPECTED = "7.1.0.4"
2424
)

server/controller/db/metadb/migrator/schema/rawsql/mysql/init.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,6 +2222,9 @@ INSERT INTO data_source (id, display_name, data_table_collection, base_data_sour
22222222
set @lcuuid = (select uuid());
22232223
INSERT INTO data_source (id, display_name, data_table_collection, `interval_time`, retention_time, summable_metrics_operator, unsummable_metrics_operator, lcuuid)
22242224
VALUES (25, '应用-性能剖析指标', 'profile.in_process_metrics', 1, 3*24, 'Sum', 'Avg', @lcuuid);
2225+
set @lcuuid = (select uuid());
2226+
INSERT INTO data_source (id, display_name, data_table_collection, `interval_time`, retention_time, summable_metrics_operator, unsummable_metrics_operator, lcuuid)
2227+
VALUES (26, '事件-IO 事件指标', 'event.file_event_metrics', 1, 7*24, 'Sum', 'Avg', @lcuuid);
22252228

22262229
CREATE TABLE IF NOT EXISTS voucher (
22272230
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
DROP PROCEDURE IF EXISTS insert_data_source;
2+
3+
CREATE PROCEDURE insert_data_source()
4+
BEGIN
5+
DECLARE existing_display_name INT DEFAULT 0;
6+
7+
SELECT COUNT(*) INTO existing_display_name
8+
FROM data_source
9+
WHERE display_name = '事件-IO 事件指标';
10+
11+
IF existing_display_name = 0 THEN
12+
START TRANSACTION;
13+
set @lcuuid = (select uuid());
14+
INSERT INTO data_source (display_name, data_table_collection, `interval_time`, retention_time, summable_metrics_operator, unsummable_metrics_operator, lcuuid)
15+
VALUES ('事件-IO 事件指标', 'event.file_event_metrics', 1, 7*24, 'Sum', 'Avg', @lcuuid);
16+
COMMIT;
17+
END IF;
18+
19+
END;
20+
21+
CALL insert_data_source();
22+
DROP PROCEDURE insert_data_source;
23+
24+
UPDATE db_version SET version='7.1.0.4';

server/controller/db/metadb/migrator/schema/rawsql/postgres/init.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,9 @@ VALUES (24, '应用-指标(天级)', 'flow_metrics.application*', 23, 86400,
16211621
INSERT INTO data_source (id, display_name, data_table_collection, interval_time, retention_time, summable_metrics_operator, unsummable_metrics_operator, lcuuid)
16221622
VALUES (25, '应用-性能剖析指标', 'profile.in_process_metrics', 1, 3 * 24, 'Sum', 'Avg', gen_random_uuid());
16231623

1624+
INSERT INTO data_source (id, display_name, data_table_collection, interval_time, retention_time, summable_metrics_operator, unsummable_metrics_operator, lcuuid)
1625+
VALUES (26, '事件-IO 事件指标', 'event.file_event_metrics', 1, 7 * 24, 'Sum', 'Avg', gen_random_uuid());
1626+
16241627
CREATE TABLE IF NOT EXISTS report (
16251628
id SERIAL PRIMARY KEY,
16261629
title VARCHAR(200) NOT NULL DEFAULT '',

server/controller/http/service/data_source.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ var DEFAULT_DATA_SOURCE_DISPLAY_NAMES = []string{
9595
"外部指标数据", // ext_metrics.*
9696
"Prometheus 数据", // prometheus.*
9797
"事件-资源变更事件", // event.event
98-
"事件-IO 事件", // event.perf_event
98+
"事件-IO 事件", // event.file_event
99+
"事件-IO 事件指标", // event.file_event_metrics
99100
"事件-告警事件", // event.alert_event
100101
"应用-性能剖析", // profile.in_process
101102
"应用-性能剖析指标", // profile.in_process_metrics

server/querier/db_descriptions/clickhouse/metrics/event/file_event.ch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
log_count , 日志总量 , 个 ,
33
bytes , 字节 , 字节 ,
44

5-
duration , 事件持续时间 , 微秒 ,
5+
duration , 持续时间 , 微秒 ,
66
row , 行数 , 个 ,

server/querier/db_descriptions/clickhouse/metrics/event/file_event.en

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
log_count , Log Count , ,
33
bytes , Bytes , Byte ,
44

5-
duration , Duration , us , Event duration
5+
duration , Duration , us ,
66
row , Row Count , ,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Field , DBField , Type , Category , Permission
2+
count , count , counter , Throughput , 111
3+
bytes , bytes , counter , Throughput , 111
4+
5+
duration , duration , delay , Delay , 111
6+
max_duration , max_duration , delay , Delay , 111
7+
avg_duration , avg_duration , delay , Delay , 111
8+
row , , other , Other , 111
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Field , DisplayName , Unit , Description
2+
count , 总量 , 个 ,
3+
bytes , 字节 , 字节 ,
4+
5+
duration , 持续时间 , 微秒 ,
6+
max_duration , 最大持续时间 , 微秒 ,
7+
avg_duration , 平均持续时间 , 微秒 ,
8+
row , 行数 , 个 ,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Field , DisplayName , Unit , Description
2+
count , Count , ,
3+
bytes , Bytes , Byte ,
4+
5+
duration , Duration , us ,
6+
max_duration , Max Duration , us ,
7+
avg_duration , Avg Duration , us ,
8+
row , Row Count , ,

0 commit comments

Comments
 (0)