未验证 提交 36c27232 编写于 作者: X Xiaoyu Wang 提交者: GitHub

Merge pull request #20530 from taosdata/feat/add-topic-total-stream-total-in-monitor

feat/add topic total and stream total in monitor
......@@ -116,6 +116,8 @@ typedef struct {
int32_t vnodes_total;
int32_t vnodes_alive;
int32_t connections_total;
int32_t topics_toal;
int32_t streams_total;
SArray *dnodes; // array of SMonDnodeDesc
SArray *mnodes; // array of SMonMnodeDesc
} SMonClusterInfo;
......
......@@ -759,6 +759,8 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr
pClusterInfo->connections_total = mndGetNumOfConnections(pMnode);
pClusterInfo->dbs_total = sdbGetSize(pSdb, SDB_DB);
pClusterInfo->stbs_total = sdbGetSize(pSdb, SDB_STB);
pClusterInfo->topics_toal = sdbGetSize(pSdb, SDB_TOPIC);
pClusterInfo->streams_total = sdbGetSize(pSdb, SDB_STREAM);
void *pIter = NULL;
while (1) {
......
......@@ -210,6 +210,8 @@ static void monGenClusterJson(SMonInfo *pMonitor) {
tjsonAddDoubleToObject(pJson, "vnodes_total", pInfo->vnodes_total);
tjsonAddDoubleToObject(pJson, "vnodes_alive", pInfo->vnodes_alive);
tjsonAddDoubleToObject(pJson, "connections_total", pInfo->connections_total);
tjsonAddDoubleToObject(pJson, "topics_total", pInfo->topics_toal);
tjsonAddDoubleToObject(pJson, "streams_total", pInfo->streams_total);
SJson *pDnodesJson = tjsonAddArrayToObject(pJson, "dnodes");
if (pDnodesJson == NULL) return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册