Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5fd6c455
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5fd6c455
编写于
9月 23, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-6452]<feature>: taoskeeper metrics collector phase 1 taosd implementation
上级
25f695cb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
58 addition
and
4 deletion
+58
-4
src/plugins/monitor/src/monMain.c
src/plugins/monitor/src/monMain.c
+58
-4
未找到文件。
src/plugins/monitor/src/monMain.c
浏览文件 @
5fd6c455
...
...
@@ -33,10 +33,12 @@
#define monDebug(...) { if (monDebugFlag & DEBUG_DEBUG) { taosPrintLog("MON ", monDebugFlag, __VA_ARGS__); }}
#define monTrace(...) { if (monDebugFlag & DEBUG_TRACE) { taosPrintLog("MON ", monDebugFlag, __VA_ARGS__); }}
#define SQL_LENGTH 1030
#define LOG_LEN_STR 512
#define IP_LEN_STR TSDB_EP_LEN
#define CHECK_INTERVAL 1000
#define SQL_LENGTH 1030
#define LOG_LEN_STR 512
#define IP_LEN_STR TSDB_EP_LEN
#define VGROUP_STATUS_LEN 512
#define DNODE_INFO_LEN 128
#define CHECK_INTERVAL 1000
typedef
enum
{
MON_CMD_CREATE_DB
,
...
...
@@ -46,6 +48,11 @@ typedef enum {
MON_CMD_CREATE_TB_DN
,
MON_CMD_CREATE_TB_ACCT_ROOT
,
MON_CMD_CREATE_TB_SLOWQUERY
,
//followings are extension for taoskeeper
MON_CMD_CREATE_TB_CLUSTER
,
MON_CMD_CREATE_MT_DNODES
,
MON_CMD_CREATE_MT_DISKS
,
MON_CMD_CREATE_MT_VGROUPS
,
MON_CMD_MAX
}
EMonCmd
;
...
...
@@ -239,6 +246,53 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) {
"create table if not exists %s.log(ts timestamp, level tinyint, "
"content binary(%d), ipaddr binary(%d))"
,
tsMonitorDbName
,
LOG_LEN_STR
,
IP_LEN_STR
);
}
else
if
(
cmd
==
MON_CMD_CREATE_TB_CLUSTER
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.cluster_info(ts timestamp"
", first_ep binary(%d), version binary(%d)"
", master_uptime float, monitor_interval int"
", dnodes_total int, dnodes_alive int"
", mnodes_total int, mnodes_alive int"
", vgroups_total int, vgroups_alive int"
", vnodes_total int, vnodes_alive int"
", connections_total int)"
,
tsMonitorDbName
,
TSDB_EP_LEN
,
TSDB_VERSION_LEN
);
}
else
if
(
cmd
==
MON_CMD_CREATE_MT_DNODES
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.dnodes_info(ts timestamp"
", uptime float"
", cpu_engine float, cpu_system float, cpu_cores int"
", mem_engine float, mem_system float, mem_total float"
", disk_engine float, disk_used float, disk_total float"
", net_in float, net_out float"
", io_read float, io_write float"
", req_http int, req_http_rate float"
", req_select int, req_select_rate float"
", req_insert int, req_insert_rate float"
", errors int"
", vnodes_num int"
", masters int"
", has_mnode bool"
") tags (dnode_id int, dnode_ep binary(%d))"
,
tsMonitorDbName
,
TSDB_EP_LEN
);
}
else
if
(
cmd
==
MON_CMD_CREATE_MT_DISKS
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.disks_info(ts timestamp"
", datadir_l0_used float, datadir_l0_total float"
", datadir_l1_used float, datadir_l1_total float"
", datadir_l2_used float, datadir_l2_total float"
") tags (dnode_id int, dnode_ep binary(%d))"
,
tsMonitorDbName
,
TSDB_EP_LEN
);
}
else
if
(
cmd
==
MON_CMD_CREATE_MT_VGROUPS
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.vgroups_info(ts timestamp"
", database_name binary(%d), is_mnode bool"
", tables_num int, status binary(%d)"
", online_vnodes tinyint"
", dnode_ids binary(%d), dnode_roles binary(%d)"
") tags (vgroup_id int)"
,
tsMonitorDbName
,
TSDB_DB_NAME_LEN
,
VGROUP_STATUS_LEN
,
DNODE_INFO_LEN
,
DNODE_INFO_LEN
);
}
sql
[
SQL_LENGTH
]
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录