Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b585766f
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
b585766f
编写于
11月 02, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-6452]<feature>: taoskeeper add HTTP status codes
上级
aad96805
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
92 addition
and
1 deletion
+92
-1
src/inc/monitor.h
src/inc/monitor.h
+68
-0
src/plugins/monitor/src/monMain.c
src/plugins/monitor/src/monMain.c
+24
-1
未找到文件。
src/inc/monitor.h
浏览文件 @
b585766f
...
...
@@ -27,6 +27,74 @@ extern "C" {
monSaveDnodeLog(level, __VA_ARGS__); \
}
#define MON_MAX_HTTP_CODE 63
static
const
char
*
monHttpStatusCodeTable
[
MON_MAX_HTTP_CODE
][
2
]
=
{
{
"HTTP_CODE_CONTINUE"
,
"100"
},
{
"HTTP_CODE_SWITCHING_PROTOCOL"
,
"101"
},
{
"HTTP_CODE_PROCESSING"
,
"102"
},
{
"HTTP_CODE_EARLY_HINTS"
,
"103"
},
{
"HTTP_CODE_OK"
,
"200"
},
{
"HTTP_CODE_CREATED"
,
"201"
},
{
"HTTP_CODE_ACCEPTED"
,
"202"
},
{
"HTTP_CODE_NON_AUTHORITATIVE_INFO"
,
"203"
},
{
"HTTP_CODE_NO_CONTENT"
,
"204"
},
{
"HTTP_CODE_RESET_CONTENT"
,
"205"
},
{
"HTTP_CODE_PARTIAL_CONTENT"
,
"206"
},
{
"HTTP_CODE_MULTI_STATUS"
,
"207"
},
{
"HTTP_CODE_ALREADY_REPORTED"
,
"208"
},
{
"HTTP_CODE_IM_USED"
,
"226"
},
{
"HTTP_CODE_MULTIPLE_CHOICE"
,
"300"
},
{
"HTTP_CODE_MOVED_PERMANENTLY"
,
"301"
},
{
"HTTP_CODE_FOUND"
,
"302"
},
{
"HTTP_CODE_SEE_OTHER"
,
"303"
},
{
"HTTP_CODE_NOT_MODIFIED"
,
"304"
},
{
"HTTP_CODE_USE_PROXY"
,
"305"
},
{
"HTTP_CODE_UNUSED"
,
"306"
},
{
"HTTP_CODE_TEMPORARY_REDIRECT"
,
"307"
},
{
"HTTP_CODE_PERMANENT_REDIRECT"
,
"308"
},
{
"HTTP_CODE_BAD_REQUEST"
,
"400"
},
{
"HTTP_CODE_UNAUTHORIZED"
,
"401"
},
{
"HTTP_CODE_PAYMENT_REQUIRED"
,
"402"
},
{
"HTTP_CODE_FORBIDDEN"
,
"403"
},
{
"HTTP_CODE_NOT_FOUND"
,
"404"
},
{
"HTTP_CODE_METHOD_NOT_ALLOWED"
,
"405"
},
{
"HTTP_CODE_NOT_ACCEPTABLE"
,
"406"
},
{
"HTTP_CODE_PROXY_AUTH_REQUIRED"
,
"407"
},
{
"HTTP_CODE_REQUEST_TIMEOUT"
,
"408"
},
{
"HTTP_CODE_CONFLICT"
,
"409"
},
{
"HTTP_CODE_GONE"
,
"410"
},
{
"HTTP_CODE_LENGTH_REQUIRED"
,
"411"
},
{
"HTTP_CODE_PRECONDITION_FAILED"
,
"412"
},
{
"HTTP_CODE_PAYLOAD_TOO_LARGE"
,
"413"
},
{
"HTTP_CODE_URI_TOO_LARGE"
,
"414"
},
{
"HTTP_CODE_UNSUPPORTED_MEDIA_TYPE"
,
"415"
},
{
"HTTP_CODE_RANGE_NOT_SATISFIABLE"
,
"416"
},
{
"HTTP_CODE_EXPECTATION_FAILED"
,
"417"
},
{
"HTTP_CODE_IM_A_TEAPOT"
,
"418"
},
{
"HTTP_CODE_MISDIRECTED_REQUEST"
,
"421"
},
{
"HTTP_CODE_UNPROCESSABLE_ENTITY"
,
"422"
},
{
"HTTP_CODE_LOCKED"
,
"423"
},
{
"HTTP_CODE_FAILED_DEPENDENCY"
,
"424"
},
{
"HTTP_CODE_TOO_EARLY"
,
"425"
},
{
"HTTP_CODE_UPGRADE_REQUIRED"
,
"426"
},
{
"HTTP_CODE_PRECONDITION_REQUIRED"
,
"428"
},
{
"HTTP_CODE_TOO_MANY_REQUESTS"
,
"429"
},
{
"HTTP_CODE_REQ_HDR_FIELDS_TOO_LARGE"
,
"431"
},
{
"HTTP_CODE_UNAVAIL_4_LEGAL_REASONS"
,
"451"
},
{
"HTTP_CODE_INTERNAL_SERVER_ERROR"
,
"500"
},
{
"HTTP_CODE_NOT_IMPLEMENTED"
,
"501"
},
{
"HTTP_CODE_BAD_GATEWAY"
,
"502"
},
{
"HTTP_CODE_SERVICE_UNAVAILABLE"
,
"503"
},
{
"HTTP_CODE_GATEWAY_TIMEOUT"
,
"504"
},
{
"HTTP_CODE_HTTP_VER_NOT_SUPPORTED"
,
"505"
},
{
"HTTP_CODE_VARIANT_ALSO_NEGOTIATES"
,
"506"
},
{
"HTTP_CODE_INSUFFICIENT_STORAGE"
,
"507"
},
{
"HTTP_CODE_LOOP_DETECTED"
,
"508"
},
{
"HTTP_CODE_NOT_EXTENDED"
,
"510"
},
{
"HTTP_CODE_NETWORK_AUTH_REQUIRED"
,
"511"
},
};
typedef
struct
{
char
*
acctId
;
int64_t
currentPointsPerSecond
;
...
...
src/plugins/monitor/src/monMain.c
浏览文件 @
b585766f
...
...
@@ -63,6 +63,8 @@ typedef enum {
MON_CMD_CREATE_MT_LOGS
,
MON_CMD_CREATE_TB_DNODE_LOG
,
MON_CMD_CREATE_TB_GRANTS
,
MON_CMD_CREATE_MT_RESTFUL
,
MON_CMD_CREATE_TB_RESTFUL
,
MON_CMD_MAX
}
EMonCmd
;
...
...
@@ -344,7 +346,28 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) {
"create table if not exists %s.grants_info(ts timestamp"
", expire_time binary(%d), timeseries binary(%d))"
,
tsMonitorDbName
,
MAX_EXPIRE_TIME_LEN
,
MAX_TIMESERIES_LEN
);
}
}
else
if
(
cmd
==
MON_CMD_CREATE_MT_RESTFUL
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.restful_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_success int, req_insert_rate float"
", req_insert_batch int, req_insert_batch_sucesss int, req_insert_batch_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_TB_RESTFUL
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.restful_%d using %s.restful_info tags(%d, '%s')"
,
tsMonitorDbName
,
dnodeGetDnodeId
(),
tsMonitorDbName
,
dnodeGetDnodeId
(),
tsLocalEp
);
sql
[
SQL_LENGTH
]
=
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录