Merge pull request #17570 from taosdata/fix/TD-19223-D
enh: add warn log for abnormal monitor value
This commit is contained in:
commit
5cff3c02d0
|
@ -66,7 +66,7 @@ void vmGetMonitorInfo(SVnodeMgmt *pMgmt, SMonVmInfo *pInfo) {
|
|||
|
||||
pInfo->vstat.totalVnodes = totalVnodes;
|
||||
pInfo->vstat.masterNum = masterNum;
|
||||
pInfo->vstat.numOfSelectReqs = numOfSelectReqs - pMgmt->state.numOfSelectReqs;
|
||||
pInfo->vstat.numOfSelectReqs = numOfSelectReqs;
|
||||
pInfo->vstat.numOfInsertReqs = numOfInsertReqs; // delta
|
||||
pInfo->vstat.numOfInsertSuccessReqs = numOfInsertSuccessReqs; // delta
|
||||
pInfo->vstat.numOfBatchInsertReqs = numOfBatchInsertReqs; // delta
|
||||
|
|
|
@ -15,10 +15,13 @@
|
|||
|
||||
#include "vnd.h"
|
||||
|
||||
#define VNODE_GET_LOAD_RESET_VALS(pVar, oVal, vType) \
|
||||
do { \
|
||||
int##vType##_t newVal = atomic_sub_fetch_##vType(&(pVar), (oVal)); \
|
||||
ASSERT(newVal >= 0); \
|
||||
#define VNODE_GET_LOAD_RESET_VALS(pVar, oVal, vType, tags) \
|
||||
do { \
|
||||
int##vType##_t newVal = atomic_sub_fetch_##vType(&(pVar), (oVal)); \
|
||||
ASSERT(newVal >= 0); \
|
||||
if (newVal < 0) { \
|
||||
vWarn("vgId:%d %s, abnormal val:%" PRIi64 ", old val:%" PRIi64, TD_VID(pVnode), tags, newVal, (oVal)); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
int vnodeQueryOpen(SVnode *pVnode) {
|
||||
|
@ -435,10 +438,10 @@ int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad) {
|
|||
* @param pLoad
|
||||
*/
|
||||
void vnodeResetLoad(SVnode *pVnode, SVnodeLoad *pLoad) {
|
||||
VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nInsert, pLoad->numOfInsertReqs, 64);
|
||||
VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nInsertSuccess, pLoad->numOfInsertSuccessReqs, 64);
|
||||
VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nBatchInsert, pLoad->numOfBatchInsertReqs, 64);
|
||||
VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nBatchInsertSuccess, pLoad->numOfBatchInsertSuccessReqs, 64);
|
||||
VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nInsert, pLoad->numOfInsertReqs, 64, "nInsert");
|
||||
VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nInsertSuccess, pLoad->numOfInsertSuccessReqs, 64, "nInsertSuccess");
|
||||
VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nBatchInsert, pLoad->numOfBatchInsertReqs, 64, "nBatchInsert");
|
||||
VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nBatchInsertSuccess, pLoad->numOfBatchInsertSuccessReqs, 64, "nBatchInsertSuccess");
|
||||
}
|
||||
|
||||
void vnodeGetInfo(SVnode *pVnode, const char **dbname, int32_t *vgId) {
|
||||
|
|
Loading…
Reference in New Issue