From 3734dd32b07a64eb4e8d7416a68f3a6abddab37a Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 11 Oct 2022 18:32:02 +0800 Subject: [PATCH] chore: code optimization for insert_req statistics --- source/dnode/vnode/src/vnd/vnodeQuery.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index d24439c850..030ba65442 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -15,12 +15,10 @@ #include "vnd.h" -#define VNODE_GET_LOAD_RESET_VALS(pVar, oVal, vType) \ - do { \ - if ((oVal) != atomic_val_compare_exchange_##vType(&(pVar), (oVal), 0)) { \ - int##vType##_t newVal = atomic_sub_fetch_##vType(&(pVar), (oVal)); \ - ASSERT(newVal >= 0); \ - } \ +#define VNODE_GET_LOAD_RESET_VALS(pVar, oVal, vType) \ + do { \ + int##vType##_t newVal = atomic_sub_fetch_##vType(&(pVar), (oVal)); \ + ASSERT(newVal >= 0); \ } while (0) int vnodeQueryOpen(SVnode *pVnode) { @@ -401,6 +399,8 @@ void vnodeResetLoad(SVnode *pVnode, SVnodeLoad *pLoad) { 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); + + } void vnodeGetInfo(SVnode *pVnode, const char **dbname, int32_t *vgId) {