Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0c23737d
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
未验证
提交
0c23737d
编写于
4月 23, 2020
作者:
S
slguan
提交者:
GitHub
4月 23, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1699 from taosdata/feature/alter
Feature/alter
上级
87158aad
1c3021cd
变更
24
展开全部
隐藏空白更改
内联
并排
Showing
24 changed file
with
534 addition
and
141 deletion
+534
-141
src/dnode/inc/dnodeLog.h
src/dnode/inc/dnodeLog.h
+0
-4
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/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/mnode/src/mgmtDb.c
src/mnode/src/mgmtDb.c
+3
-1
src/mnode/src/mgmtDnode.c
src/mnode/src/mgmtDnode.c
+3
-3
src/mnode/src/mgmtSdb.c
src/mnode/src/mgmtSdb.c
+2
-0
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+18
-18
src/mnode/src/mgmtUser.c
src/mnode/src/mgmtUser.c
+4
-0
src/mnode/src/mgmtVgroup.c
src/mnode/src/mgmtVgroup.c
+8
-5
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
-42
src/plugins/monitor/src/monitorMain.c
src/plugins/monitor/src/monitorMain.c
+431
-0
src/vnode/inc/vnodeLog.h
src/vnode/inc/vnodeLog.h
+0
-4
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+3
-0
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+1
-1
tests/script/unique/account/account_delete.sim
tests/script/unique/account/account_delete.sim
+10
-3
tests/script/unique/account/basic.sim
tests/script/unique/account/basic.sim
+1
-1
tests/script/unique/account/monitor.sim
tests/script/unique/account/monitor.sim
+0
-36
tests/script/unique/account/paras.sim
tests/script/unique/account/paras.sim
+1
-1
tests/script/unique/account/testSuite.sim
tests/script/unique/account/testSuite.sim
+3
-0
tests/script/unique/account/usage.sim
tests/script/unique/account/usage.sim
+1
-1
未找到文件。
src/dnode/inc/dnodeLog.h
浏览文件 @
0c23737d
...
...
@@ -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/dnode/src/dnodeModule.c
浏览文件 @
0c23737d
...
...
@@ -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
浏览文件 @
0c23737d
...
...
@@ -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/inc/monitor.h
浏览文件 @
0c23737d
...
...
@@ -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
浏览文件 @
0c23737d
...
...
@@ -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
浏览文件 @
0c23737d
...
...
@@ -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/mnode/src/mgmtDb.c
浏览文件 @
0c23737d
...
...
@@ -884,6 +884,8 @@ void mgmtDropAllDbs(SAcctObj *pAcct) {
SDbObj
*
pDb
=
NULL
;
void
*
pNode
=
NULL
;
mPrint
(
"acct:%s, all dbs will be dropped from sdb"
,
pAcct
->
user
);
while
(
1
)
{
pNode
=
sdbFetchRow
(
tsDbSdb
,
pNode
,
(
void
**
)
&
pDb
);
if
(
pDb
==
NULL
)
break
;
...
...
@@ -902,5 +904,5 @@ void mgmtDropAllDbs(SAcctObj *pAcct) {
mgmtDecDbRef
(
pDb
);
}
m
Trace
(
"acct:%s, all dbs is
is dropped from sdb"
,
pAcct
->
user
,
numOfDbs
);
m
Print
(
"acct:%s, all dbs:%d
is dropped from sdb"
,
pAcct
->
user
,
numOfDbs
);
}
src/mnode/src/mgmtDnode.c
浏览文件 @
0c23737d
...
...
@@ -260,7 +260,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
}
uint32_t
dnodeIp
=
inet_addr
(
pCmCfgDnode
->
ip
);
if
(
strcmp
(
pMsg
->
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pMsg
->
pUser
->
user
,
"root"
)
!=
0
)
{
rpcRsp
.
code
=
TSDB_CODE_NO_RIGHTS
;
}
else
{
SRpcIpSet
ipSet
=
mgmtGetIpSetFromIp
(
dnodeIp
);
...
...
@@ -469,7 +469,7 @@ static void mgmtProcessCreateDnodeMsg(SQueuedMsg *pMsg) {
SCMCreateDnodeMsg
*
pCreate
=
pMsg
->
pCont
;
if
(
strcmp
(
pMsg
->
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pMsg
->
pUser
->
user
,
"root"
)
!=
0
)
{
rpcRsp
.
code
=
TSDB_CODE_NO_RIGHTS
;
}
else
{
uint32_t
ip
=
inet_addr
(
pCreate
->
ip
);
...
...
@@ -489,7 +489,7 @@ static void mgmtProcessDropDnodeMsg(SQueuedMsg *pMsg) {
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
thandle
,
.
pCont
=
NULL
,
.
contLen
=
0
,
.
code
=
0
,
.
msgType
=
0
};
SCMDropDnodeMsg
*
pDrop
=
pMsg
->
pCont
;
if
(
strcmp
(
pMsg
->
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pMsg
->
pUser
->
user
,
"root"
)
!=
0
)
{
rpcRsp
.
code
=
TSDB_CODE_NO_RIGHTS
;
}
else
{
uint32_t
ip
=
inet_addr
(
pDrop
->
ip
);
...
...
src/mnode/src/mgmtSdb.c
浏览文件 @
0c23737d
...
...
@@ -400,6 +400,8 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) {
if
(
pTable
->
keyType
==
SDB_KEY_AUTO
)
{
pTable
->
autoIndex
=
MAX
(
pTable
->
autoIndex
,
*
((
uint32_t
*
)
pOper
->
pObj
));
}
else
{
pTable
->
autoIndex
++
;
}
pthread_mutex_unlock
(
&
pTable
->
mutex
);
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
0c23737d
...
...
@@ -1112,12 +1112,11 @@ void mgmtDropAllSuperTables(SDbObj *pDropDb) {
int32_t
dbNameLen
=
strlen
(
pDropDb
->
name
);
SSuperTableObj
*
pTable
=
NULL
;
mPrint
(
"db:%s, all super tables will be dropped from sdb"
,
pDropDb
->
name
);
while
(
1
)
{
mgmtDecTableRef
(
pTable
);
pNode
=
sdbFetchRow
(
tsSuperTableSdb
,
pNode
,
(
void
**
)
&
pTable
);
if
(
pTable
==
NULL
)
{
break
;
}
if
(
pTable
==
NULL
)
break
;
if
(
strncmp
(
pDropDb
->
name
,
pTable
->
info
.
tableId
,
dbNameLen
)
==
0
)
{
SSdbOper
oper
=
{
...
...
@@ -1128,10 +1127,12 @@ void mgmtDropAllSuperTables(SDbObj *pDropDb) {
sdbDeleteRow
(
&
oper
);
pNode
=
pLastNode
;
numOfTables
++
;
continue
;
}
mgmtDecTableRef
(
pTable
);
}
mTrace
(
"db:%s, all super tables:%d is dropped from sdb"
,
pDropDb
->
name
,
numOfTables
);
mPrint
(
"db:%s, all super tables:%d is dropped from sdb"
,
pDropDb
->
name
,
numOfTables
);
}
static
int32_t
mgmtSetSchemaFromSuperTable
(
SSchema
*
pSchema
,
SSuperTableObj
*
pTable
)
{
...
...
@@ -1681,12 +1682,11 @@ void mgmtDropAllChildTables(SDbObj *pDropDb) {
int32_t
dbNameLen
=
strlen
(
pDropDb
->
name
);
SChildTableObj
*
pTable
=
NULL
;
mPrint
(
"db:%s, all child tables will be dropped from sdb"
,
pDropDb
->
name
);
while
(
1
)
{
mgmtDecTableRef
(
pTable
);
pNode
=
sdbFetchRow
(
tsChildTableSdb
,
pNode
,
(
void
**
)
&
pTable
);
if
(
pTable
==
NULL
)
{
break
;
}
if
(
pTable
==
NULL
)
break
;
if
(
strncmp
(
pDropDb
->
name
,
pTable
->
info
.
tableId
,
dbNameLen
)
==
0
)
{
SSdbOper
oper
=
{
...
...
@@ -1697,11 +1697,11 @@ void mgmtDropAllChildTables(SDbObj *pDropDb) {
sdbDeleteRow
(
&
oper
);
pNode
=
pLastNode
;
numOfTables
++
;
continue
;
}
mgmtDecTableRef
(
pTable
);
}
m
Trace
(
"db:%s, all child tables:%d is dropped from sdb"
,
pDropDb
->
name
,
numOfTables
);
m
Print
(
"db:%s, all child tables:%d is dropped from sdb"
,
pDropDb
->
name
,
numOfTables
);
}
static
void
mgmtDropAllChildTablesInStable
(
SSuperTableObj
*
pStable
)
{
...
...
@@ -1710,12 +1710,11 @@ static void mgmtDropAllChildTablesInStable(SSuperTableObj *pStable) {
int32_t
numOfTables
=
0
;
SChildTableObj
*
pTable
=
NULL
;
mPrint
(
"stable:%s, all child tables will dropped from sdb"
,
pStable
->
info
.
tableId
,
numOfTables
);
while
(
1
)
{
mgmtDecTableRef
(
pTable
);
pNode
=
sdbFetchRow
(
tsChildTableSdb
,
pNode
,
(
void
**
)
&
pTable
);
if
(
pTable
==
NULL
)
{
break
;
}
if
(
pTable
==
NULL
)
break
;
if
(
pTable
->
superTable
==
pStable
)
{
SSdbOper
oper
=
{
...
...
@@ -1726,11 +1725,12 @@ static void mgmtDropAllChildTablesInStable(SSuperTableObj *pStable) {
sdbDeleteRow
(
&
oper
);
pNode
=
pLastNode
;
numOfTables
++
;
continue
;
}
mgmtDecTableRef
(
pTable
);
}
m
Trace
(
"stable:%s, all child tables:%d is dropped from sdb"
,
pStable
->
info
.
tableId
,
numOfTables
);
m
Print
(
"stable:%s, all child tables:%d is dropped from sdb"
,
pStable
->
info
.
tableId
,
numOfTables
);
}
static
SChildTableObj
*
mgmtGetTableByPos
(
uint32_t
dnodeId
,
int32_t
vnode
,
int32_t
sid
)
{
...
...
src/mnode/src/mgmtUser.c
浏览文件 @
0c23737d
...
...
@@ -353,6 +353,7 @@ static void mgmtProcessCreateUserMsg(SQueuedMsg *pMsg) {
mLPrint
(
"user:%s, is created by %s"
,
pCreate
->
user
,
pOperUser
->
user
);
}
}
else
{
mError
(
"user:%s, no rights to create user"
,
pOperUser
->
user
);
code
=
TSDB_CODE_NO_RIGHTS
;
}
...
...
@@ -398,6 +399,7 @@ static void mgmtProcessAlterUserMsg(SQueuedMsg *pMsg) {
code
=
mgmtUpdateUser
(
pUser
);
mLPrint
(
"user:%s, password is altered by %s, result:%s"
,
pUser
->
user
,
pOperUser
->
user
,
tstrerror
(
code
));
}
else
{
mError
(
"user:%s, no rights to ater user"
,
pOperUser
->
user
);
code
=
TSDB_CODE_NO_RIGHTS
;
}
...
...
@@ -440,11 +442,13 @@ static void mgmtProcessAlterUserMsg(SQueuedMsg *pMsg) {
code
=
mgmtUpdateUser
(
pUser
);
mLPrint
(
"user:%s, privilege is altered by %s, result:%s"
,
pUser
->
user
,
pOperUser
->
user
,
tstrerror
(
code
));
}
else
{
mError
(
"user:%s, no rights to ater user"
,
pOperUser
->
user
);
code
=
TSDB_CODE_NO_RIGHTS
;
}
mgmtSendSimpleResp
(
pMsg
->
thandle
,
code
);
}
else
{
mError
(
"user:%s, no rights to ater user"
,
pOperUser
->
user
);
mgmtSendSimpleResp
(
pMsg
->
thandle
,
TSDB_CODE_NO_RIGHTS
);
}
...
...
src/mnode/src/mgmtVgroup.c
浏览文件 @
0c23737d
...
...
@@ -744,12 +744,13 @@ static void mgmtProcessVnodeCfgMsg(SRpcMsg *rpcMsg) {
void
mgmtDropAllVgroups
(
SDbObj
*
pDropDb
)
{
void
*
pNode
=
NULL
;
void
*
pLastNode
=
NULL
;
int32_t
numOf
Table
s
=
0
;
int32_t
numOf
Vgroup
s
=
0
;
int32_t
dbNameLen
=
strlen
(
pDropDb
->
name
);
SVgObj
*
pVgroup
=
NULL
;
mPrint
(
"db:%s, all vgroups will be dropped from sdb"
,
pDropDb
->
name
);
while
(
1
)
{
mgmtDecVgroupRef
(
pVgroup
);
pNode
=
sdbFetchRow
(
tsVgroupSdb
,
pNode
,
(
void
**
)
&
pVgroup
);
if
(
pVgroup
==
NULL
)
break
;
...
...
@@ -761,12 +762,14 @@ void mgmtDropAllVgroups(SDbObj *pDropDb) {
};
sdbDeleteRow
(
&
oper
);
pNode
=
pLastNode
;
numOfTables
++
;
continue
;
numOfVgroups
++
;
}
mgmtSendDropVgroupMsg
(
pVgroup
,
NULL
);
mgmtDecVgroupRef
(
pVgroup
);
}
m
Trace
(
"db:%s, all vgroups is dropped from sdb"
,
pDropDb
->
name
,
numOfTable
s
);
m
Print
(
"db:%s, all vgroups:%d is dropped from sdb"
,
pDropDb
->
name
,
numOfVgroup
s
);
}
void
mgmtAlterVgroup
(
SVgObj
*
pVgroup
,
void
*
ahandle
)
{
...
...
src/plugins/http/inc/httpLog.h
浏览文件 @
0c23737d
...
...
@@ -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
浏览文件 @
87158aad
/*
* 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>
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
,
...);
#ifdef __cplusplus
}
#endif
#endif
\ No newline at end of file
src/plugins/monitor/src/monitor
System
.c
→
src/plugins/monitor/src/monitor
Main
.c
浏览文件 @
0c23737d
此差异已折叠。
点击以展开。
src/vnode/inc/vnodeLog.h
浏览文件 @
0c23737d
...
...
@@ -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
浏览文件 @
0c23737d
...
...
@@ -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
;
...
...
tests/script/sh/deploy.sh
浏览文件 @
0c23737d
...
...
@@ -93,7 +93,7 @@ echo "privateIp $NODE_IP" >> $TAOS_CFG
echo
"dDebugFlag 199"
>>
$TAOS_CFG
echo
"mDebugFlag 199"
>>
$TAOS_CFG
echo
"sdbDebugFlag 199"
>>
$TAOS_CFG
echo
"rpcDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"rpcDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"cDebugFlag 135"
>>
$TAOS_CFG
echo
"httpDebugFlag 131"
>>
$TAOS_CFG
...
...
tests/script/unique/account/account_delete.sim
浏览文件 @
0c23737d
...
...
@@ -59,10 +59,17 @@ endi
sql drop account oroot
print ============= step4
sleep 2000
$x = 0
show4:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
if $data0
2
!= 0 then
return -1
if $data0
3
!= 0 then
goto show4
endi
print ============= step5
...
...
tests/script/unique/account/basic.sim
浏览文件 @
0c23737d
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/exec_up
_up
.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sql connect
print =============== show accounts
...
...
tests/script/unique/account/monitor.sim
已删除
100644 → 0
浏览文件 @
87158aad
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c monitor -v 0
print ========== step1
system sh/cfg.sh -n dnode1 -c monitor -v 1
system sh/cfg.sh -n dnode1 -c monitorInterval -v 1
system sh/exec_up.sh -n dnode1 -s start
sql connect
sleep 3000
print ========== step2
sql drop database log -x step21
return -1
step21:
sql drop table log.cpu -x step22
return -1
step22:
sql drop user log -x step23
return -1
step23:
print ========== step3
sleep 3000
sql select * from log.dn
if $rows == 0 then
return -1
endi
tests/script/unique/account/paras.sim
浏览文件 @
0c23737d
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/exec_up
_up
.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sql connect
print =============== show accounts
...
...
tests/script/unique/account/testSuite.sim
浏览文件 @
0c23737d
...
...
@@ -6,4 +6,7 @@ run unique/account/pass_len.sim
run unique/account/user_create.sim
run unique/account/user_len.sim
run unique/account/authority.sim
run unique/account/basic.sim
run unique/account/paras.sim
run unique/account/usage.sim
run unique/account/monitor.sim
tests/script/unique/account/usage.sim
浏览文件 @
0c23737d
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/exec_up
_up
.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sql connect
print =============== show accounts
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录