Merge pull request #20530 from taosdata/feat/add-topic-total-stream-total-in-monitor
feat/add topic total and stream total in monitor
This commit is contained in:
commit
36c272323d
|
@ -116,6 +116,8 @@ typedef struct {
|
||||||
int32_t vnodes_total;
|
int32_t vnodes_total;
|
||||||
int32_t vnodes_alive;
|
int32_t vnodes_alive;
|
||||||
int32_t connections_total;
|
int32_t connections_total;
|
||||||
|
int32_t topics_toal;
|
||||||
|
int32_t streams_total;
|
||||||
SArray *dnodes; // array of SMonDnodeDesc
|
SArray *dnodes; // array of SMonDnodeDesc
|
||||||
SArray *mnodes; // array of SMonMnodeDesc
|
SArray *mnodes; // array of SMonMnodeDesc
|
||||||
} SMonClusterInfo;
|
} SMonClusterInfo;
|
||||||
|
|
|
@ -759,6 +759,8 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr
|
||||||
pClusterInfo->connections_total = mndGetNumOfConnections(pMnode);
|
pClusterInfo->connections_total = mndGetNumOfConnections(pMnode);
|
||||||
pClusterInfo->dbs_total = sdbGetSize(pSdb, SDB_DB);
|
pClusterInfo->dbs_total = sdbGetSize(pSdb, SDB_DB);
|
||||||
pClusterInfo->stbs_total = sdbGetSize(pSdb, SDB_STB);
|
pClusterInfo->stbs_total = sdbGetSize(pSdb, SDB_STB);
|
||||||
|
pClusterInfo->topics_toal = sdbGetSize(pSdb, SDB_TOPIC);
|
||||||
|
pClusterInfo->streams_total = sdbGetSize(pSdb, SDB_STREAM);
|
||||||
|
|
||||||
void *pIter = NULL;
|
void *pIter = NULL;
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
|
@ -210,6 +210,8 @@ static void monGenClusterJson(SMonInfo *pMonitor) {
|
||||||
tjsonAddDoubleToObject(pJson, "vnodes_total", pInfo->vnodes_total);
|
tjsonAddDoubleToObject(pJson, "vnodes_total", pInfo->vnodes_total);
|
||||||
tjsonAddDoubleToObject(pJson, "vnodes_alive", pInfo->vnodes_alive);
|
tjsonAddDoubleToObject(pJson, "vnodes_alive", pInfo->vnodes_alive);
|
||||||
tjsonAddDoubleToObject(pJson, "connections_total", pInfo->connections_total);
|
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");
|
SJson *pDnodesJson = tjsonAddArrayToObject(pJson, "dnodes");
|
||||||
if (pDnodesJson == NULL) return;
|
if (pDnodesJson == NULL) return;
|
||||||
|
|
Loading…
Reference in New Issue