Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7dc72d3f
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看板
提交
7dc72d3f
编写于
4月 23, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-91] make monitor work
上级
6dbca070
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
180 addition
and
197 deletion
+180
-197
src/dnode/src/dnodeModule.c
src/dnode/src/dnodeModule.c
+2
-2
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+6
-5
src/mnode/src/mgmtSdb.c
src/mnode/src/mgmtSdb.c
+2
-2
src/plugins/monitor/inc/monitorSystem.h
src/plugins/monitor/inc/monitorSystem.h
+28
-11
src/plugins/monitor/src/monitorSystem.c
src/plugins/monitor/src/monitorSystem.c
+142
-177
未找到文件。
src/dnode/src/dnodeModule.c
浏览文件 @
7dc72d3f
...
...
@@ -90,7 +90,7 @@ void dnodeCleanUpModules() {
int32_t
dnodeInitModules
()
{
dnodeAllocModules
();
for
(
int32_t
module
=
0
;
module
<
TSDB_MOD_MAX
;
++
module
)
{
for
(
EModuleType
module
=
0
;
module
<
TSDB_MOD_MAX
;
++
module
)
{
if
(
tsModule
[
module
].
initFp
)
{
if
((
*
tsModule
[
module
].
initFp
)()
!=
0
)
{
dError
(
"failed to init module:%s"
,
tsModule
[
module
].
name
);
...
...
@@ -103,7 +103,7 @@ int32_t dnodeInitModules() {
}
void
dnodeStartModules
()
{
for
(
int32_t
module
=
1
;
module
<
TSDB_MOD_MAX
;
++
module
)
{
for
(
EModuleType
module
=
1
;
module
<
TSDB_MOD_MAX
;
++
module
)
{
if
(
tsModule
[
module
].
enable
&&
tsModule
[
module
].
startFp
)
{
if
((
*
tsModule
[
module
].
startFp
)()
!=
0
)
{
dError
(
"failed to start module:%s"
,
tsModule
[
module
].
name
);
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
7dc72d3f
...
...
@@ -20,16 +20,17 @@
#include "taosmsg.h"
#include "trpc.h"
#include "tglobal.h"
#include "http.h"
#include "dnode.h"
#include "dnodeLog.h"
#include "dnodeRead.h"
#include "dnodeWrite.h"
#include "dnodeShell.h"
static
void
(
*
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
);
static
void
dnodeProcessMsgFromShell
(
SRpcMsg
*
pMsg
);
static
int
dnodeRetrieveUserAuthInfo
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
static
void
*
tsDnodeShellRpc
=
NULL
;
static
void
(
*
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
);
static
void
dnodeProcessMsgFromShell
(
SRpcMsg
*
pMsg
);
static
int
dnodeRetrieveUserAuthInfo
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
static
void
*
tsDnodeShellRpc
=
NULL
;
static
int32_t
tsDnodeQueryReqNum
=
0
;
static
int32_t
tsDnodeSubmitReqNum
=
0
;
...
...
@@ -110,7 +111,7 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char
SDnodeStatisInfo
dnodeGetStatisInfo
()
{
SDnodeStatisInfo
info
=
{
0
};
if
(
dnodeGetRunStatus
()
==
TSDB_DNODE_RUN_STATUS_RUNING
)
{
//
info.httpReqNum = httpGetReqCount();
info
.
httpReqNum
=
httpGetReqCount
();
info
.
queryReqNum
=
atomic_exchange_32
(
&
tsDnodeQueryReqNum
,
0
);
info
.
submitReqNum
=
atomic_exchange_32
(
&
tsDnodeSubmitReqNum
,
0
);
}
...
...
src/mnode/src/mgmtSdb.c
浏览文件 @
7dc72d3f
...
...
@@ -333,7 +333,7 @@ void sdbIncRef(void *handle, void *pRow) {
SSdbTable
*
pTable
=
handle
;
int32_t
*
pRefCount
=
(
int32_t
*
)(
pRow
+
pTable
->
refCountPos
);
atomic_add_fetch_32
(
pRefCount
,
1
);
if
(
1
&&
strcmp
(
pTable
->
tableName
,
"accounts"
)
==
0
)
{
if
(
0
&&
strcmp
(
pTable
->
tableName
,
"accounts"
)
==
0
)
{
sdbTrace
(
"table:%s, add ref to record:%s:%s:%d"
,
pTable
->
tableName
,
pTable
->
tableName
,
sdbGetkeyStr
(
pTable
,
pRow
),
*
pRefCount
);
}
...
...
@@ -345,7 +345,7 @@ void sdbDecRef(void *handle, void *pRow) {
SSdbTable
*
pTable
=
handle
;
int32_t
*
pRefCount
=
(
int32_t
*
)(
pRow
+
pTable
->
refCountPos
);
int32_t
refCount
=
atomic_sub_fetch_32
(
pRefCount
,
1
);
if
(
1
&&
strcmp
(
pTable
->
tableName
,
"accounts"
)
==
0
)
{
if
(
0
&&
strcmp
(
pTable
->
tableName
,
"accounts"
)
==
0
)
{
sdbTrace
(
"table:%s, def ref of record:%s:%s:%d"
,
pTable
->
tableName
,
pTable
->
tableName
,
sdbGetkeyStr
(
pTable
,
pRow
),
*
pRefCount
);
}
...
...
src/plugins/monitor/inc/monitorSystem.h
浏览文件 @
7dc72d3f
...
...
@@ -23,17 +23,34 @@ extern "C" {
#include <stdbool.h>
#include <stdint.h>
int32_t
monitorInitSystem
();
int32_t
monitorStartSystem
();
void
monitorStopSystem
();
void
monitorCleanUpSystem
();
void
monitorSaveAcctLog
(
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
);
void
monitorSaveLog
(
int
level
,
const
char
*
const
format
,
...);
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
}
...
...
src/plugins/monitor/src/monitorSystem.c
浏览文件 @
7dc72d3f
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录