Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yiicenne
TDengine
提交
1c3021cd
TDengine
项目概览
yiicenne
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1c3021cd
编写于
4月 23, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-91] refactor monitor module
上级
7dc72d3f
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
48 addition
and
84 deletion
+48
-84
src/dnode/inc/dnodeLog.h
src/dnode/inc/dnodeLog.h
+0
-4
src/inc/monitor.h
src/inc/monitor.h
+30
-2
src/inc/taosmsg.h
src/inc/taosmsg.h
+0
-1
src/mnode/inc/mgmtLog.h
src/mnode/inc/mgmtLog.h
+7
-6
src/plugins/http/inc/httpLog.h
src/plugins/http/inc/httpLog.h
+0
-5
src/plugins/monitor/inc/monitorSystem.h
src/plugins/monitor/inc/monitorSystem.h
+0
-59
src/plugins/monitor/src/monitorMain.c
src/plugins/monitor/src/monitorMain.c
+8
-3
src/vnode/inc/vnodeLog.h
src/vnode/inc/vnodeLog.h
+0
-4
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+3
-0
未找到文件。
src/dnode/inc/dnodeLog.h
浏览文件 @
1c3021cd
...
...
@@ -39,10 +39,6 @@ extern int32_t ddebugFlag;
#define dPrint(...) \
{ taosPrintLog("DND ", 255, __VA_ARGS__); }
#define dLError(...) taosLogError(__VA_ARGS__) dError(__VA_ARGS__)
#define dLWarn(...) taosLogWarn(__VA_ARGS__) dWarn(__VA_ARGS__)
#define dLPrint(...) taosLogPrint(__VA_ARGS__) dPrint(__VA_ARGS__)
#ifdef __cplusplus
}
#endif
...
...
src/inc/monitor.h
浏览文件 @
1c3021cd
...
...
@@ -22,10 +22,38 @@ extern "C" {
#include <stdint.h>
typedef
struct
{
char
*
acctId
;
int64_t
currentPointsPerSecond
;
int64_t
maxPointsPerSecond
;
int64_t
totalTimeSeries
;
int64_t
maxTimeSeries
;
int64_t
totalStorage
;
int64_t
maxStorage
;
int64_t
totalQueryTime
;
int64_t
maxQueryTime
;
int64_t
totalInbound
;
int64_t
maxInbound
;
int64_t
totalOutbound
;
int64_t
maxOutbound
;
int64_t
totalDbs
;
int64_t
maxDbs
;
int64_t
totalUsers
;
int64_t
maxUsers
;
int64_t
totalStreams
;
int64_t
maxStreams
;
int64_t
totalConns
;
int64_t
maxConns
;
int8_t
accessState
;
}
SAcctMonitorObj
;
int32_t
monitorInitSystem
();
int32_t
monitorStartSystem
();
void
monitorStopSystem
();
void
monitorCleanUpSystem
();
void
monitorStopSystem
();
void
monitorCleanUpSystem
();
void
monitorSaveAcctLog
(
SAcctMonitorObj
*
pMonObj
);
void
monitorSaveLog
(
int32_t
level
,
const
char
*
const
format
,
...);
void
monitorExecuteSQL
(
char
*
sql
);
#ifdef __cplusplus
}
...
...
src/inc/taosmsg.h
浏览文件 @
1c3021cd
...
...
@@ -509,7 +509,6 @@ typedef struct {
int64_t
pointsWritten
;
uint8_t
status
;
uint8_t
role
;
uint8_t
accessState
;
uint8_t
replica
;
uint8_t
reserved
[
5
];
}
SVnodeLoad
;
...
...
src/mnode/inc/mgmtLog.h
浏览文件 @
1c3021cd
...
...
@@ -21,6 +21,7 @@ extern "C" {
#endif
#include "tlog.h"
#include "monitor.h"
extern
int32_t
mdebugFlag
;
extern
int32_t
sdbDebugFlag
;
...
...
@@ -41,9 +42,9 @@ extern int32_t sdbDebugFlag;
#define mPrint(...) \
{ taosPrintLog("MND ", 255, __VA_ARGS__); }
#define mLError(...) mError(__VA_ARGS__)
#define mLWarn(...) mWarn(__VA_ARGS__)
#define mLPrint(...) mPrint(__VA_ARGS__)
#define mLError(...) m
onitorSaveLog(2, __VA_ARGS__); m
Error(__VA_ARGS__)
#define mLWarn(...) m
onitorSaveLog(1, __VA_ARGS__); m
Warn(__VA_ARGS__)
#define mLPrint(...) m
onitorSaveLog(0, __VA_ARGS__); m
Print(__VA_ARGS__)
#define sdbError(...) \
if (sdbDebugFlag & DEBUG_ERROR) { \
...
...
@@ -60,9 +61,9 @@ extern int32_t sdbDebugFlag;
#define sdbPrint(...) \
{ taosPrintLog("MND-SDB ", 255, __VA_ARGS__); }
#define sdbLError(...) sdbError(__VA_ARGS__)
#define sdbLWarn(...) sdbWarn(__VA_ARGS__)
#define sdbLPrint(...) sdbPrint(__VA_ARGS__)
#define sdbLError(...)
monitorSaveLog(2, __VA_ARGS__);
sdbError(__VA_ARGS__)
#define sdbLWarn(...)
monitorSaveLog(1, __VA_ARGS__);
sdbWarn(__VA_ARGS__)
#define sdbLPrint(...)
monitorSaveLog(0, __VA_ARGS__);
sdbPrint(__VA_ARGS__)
#ifdef __cplusplus
}
...
...
src/plugins/http/inc/httpLog.h
浏览文件 @
1c3021cd
...
...
@@ -39,9 +39,4 @@ extern int32_t httpDebugFlag;
#define httpPrint(...) \
{ taosPrintLog("HTP ", 255, __VA_ARGS__); }
#define httpLError(...) taosLogError(__VA_ARGS__) httpError(__VA_ARGS__)
#define httpLWarn(...) taosLogWarn(__VA_ARGS__) httpWarn(__VA_ARGS__)
#define httpLPrint(...) taosLogPrint(__VA_ARGS__) httpPrint(__VA_ARGS__)
#endif
src/plugins/monitor/inc/monitorSystem.h
已删除
100644 → 0
浏览文件 @
7dc72d3f
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_MONITOR_SYSTEM_H
#define TDENGINE_MONITOR_SYSTEM_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include <stdbool.h>
#include <stdint.h>
typedef
struct
{
char
*
acctId
;
int64_t
currentPointsPerSecond
;
int64_t
maxPointsPerSecond
;
int64_t
totalTimeSeries
;
int64_t
maxTimeSeries
;
int64_t
totalStorage
;
int64_t
maxStorage
;
int64_t
totalQueryTime
;
int64_t
maxQueryTime
;
int64_t
totalInbound
;
int64_t
maxInbound
;
int64_t
totalOutbound
;
int64_t
maxOutbound
;
int64_t
totalDbs
;
int64_t
maxDbs
;
int64_t
totalUsers
;
int64_t
maxUsers
;
int64_t
totalStreams
;
int64_t
maxStreams
;
int64_t
totalConns
;
int64_t
maxConns
;
int8_t
accessState
;
}
SAcctMonitorObj
;
void
monitorSaveAcctLog
(
SAcctMonitorObj
*
pMonObj
);
void
monitorSaveLog
(
int32_t
level
,
const
char
*
const
format
,
...);
void
monitorExecuteSQL
(
char
*
sql
);
#ifdef __cplusplus
}
#endif
#endif
\ No newline at end of file
src/plugins/monitor/src/monitor
System
.c
→
src/plugins/monitor/src/monitor
Main
.c
浏览文件 @
1c3021cd
...
...
@@ -25,7 +25,7 @@
#include "tscUtil.h"
#include "tsclient.h"
#include "dnode.h"
#include "monitor
System
.h"
#include "monitor.h"
#define monitorError(...) \
if (monitorDebugFlag & DEBUG_ERROR) { \
...
...
@@ -228,7 +228,6 @@ static void monitorInitDatabaseCb(void *param, TAOS_RES *result, int32_t code) {
void
monitorStopSystem
()
{
monitorPrint
(
"monitor module is stopped"
);
tsMonitorConn
.
state
=
MONITOR_STATE_STOPPED
;
// taosLogFp = NULL;
if
(
tsMonitorConn
.
initTimer
!=
NULL
)
{
taosTmrStopA
(
&
(
tsMonitorConn
.
initTimer
));
}
...
...
@@ -399,6 +398,8 @@ void monitorSaveAcctLog(SAcctMonitorObj *pMon) {
}
void
monitorSaveLog
(
int32_t
level
,
const
char
*
const
format
,
...)
{
if
(
tsMonitorConn
.
state
!=
MONITOR_STATE_INITIALIZED
)
return
;
va_list
argpointer
;
char
sql
[
SQL_LENGTH
]
=
{
0
};
int32_t
max_length
=
SQL_LENGTH
-
30
;
...
...
@@ -421,6 +422,10 @@ void monitorSaveLog(int32_t level, const char *const format, ...) {
}
void
monitorExecuteSQL
(
char
*
sql
)
{
if
(
tsMonitorConn
.
state
!=
MONITOR_STATE_INITIALIZED
)
return
;
monitorTrace
(
"monitor:%p, execute sql: %s"
,
tsMonitorConn
.
conn
,
sql
);
taos_query_a
(
tsMonitorConn
.
conn
,
sql
,
NULL
,
NULL
);
// bug while insert binary
// taos_query_a(tsMonitorConn.conn, sql, NULL, NULL);
}
src/vnode/inc/vnodeLog.h
浏览文件 @
1c3021cd
...
...
@@ -39,10 +39,6 @@ extern int32_t ddebugFlag;
#define dPrint(...) \
{ taosPrintLog("DND ", 255, __VA_ARGS__); }
#define dLError(...) taosLogError(__VA_ARGS__) dError(__VA_ARGS__)
#define dLWarn(...) taosLogWarn(__VA_ARGS__) dWarn(__VA_ARGS__)
#define dLPrint(...) taosLogPrint(__VA_ARGS__) dPrint(__VA_ARGS__)
#ifdef __cplusplus
}
#endif
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
1c3021cd
...
...
@@ -332,6 +332,9 @@ static void vnodeBuildVloadMsg(char *pNode, void * param) {
SVnodeLoad
*
pLoad
=
&
pStatus
->
load
[
pStatus
->
openVnodes
++
];
pLoad
->
vgId
=
htonl
(
pVnode
->
vgId
);
pLoad
->
totalStorage
=
htobe64
(
pLoad
->
totalStorage
);
pLoad
->
compStorage
=
htobe64
(
pLoad
->
compStorage
);
pLoad
->
pointsWritten
=
htobe64
(
pLoad
->
pointsWritten
);
pLoad
->
status
=
pVnode
->
status
;
pLoad
->
role
=
pVnode
->
role
;
pLoad
->
replica
=
pVnode
->
syncCfg
.
replica
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录