enable switch
This commit is contained in:
parent
cf753cf2e0
commit
34cda13494
|
@ -484,7 +484,7 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC
|
|||
snprintf(pVnode->monitor.strDnodeId, TSDB_NODE_ID_LEN, "%"PRId32, pVnode->config.syncCfg.nodeInfo[0].nodeId);
|
||||
snprintf(pVnode->monitor.strVgId, TSDB_VGROUP_ID_LEN, "%"PRId32, pVnode->config.vgId);
|
||||
|
||||
if(pVnode->monitor.insertCounter == NULL){
|
||||
if(tsEnableMonitor && pVnode->monitor.insertCounter == NULL){
|
||||
taos_counter_t *counter = NULL;
|
||||
counter = taos_collector_registry_get_metric(VNODE_METRIC_SQL_COUNT);
|
||||
if(counter == NULL){
|
||||
|
@ -501,9 +501,9 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC
|
|||
counter = taos_collector_registry_get_metric(VNODE_METRIC_SQL_COUNT);
|
||||
vInfo("vgId:%d, get metric from registry:%p",TD_VID(pVnode), counter);
|
||||
}
|
||||
pVnode->monitor.insertCounter = counter;
|
||||
vInfo("vgId:%d, succeed to set metric:%p",TD_VID(pVnode), counter);
|
||||
}
|
||||
pVnode->monitor.insertCounter = counter;
|
||||
vInfo("vgId:%d, succeed to set metric:%p",TD_VID(pVnode), counter);
|
||||
}
|
||||
|
||||
return pVnode;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "audit.h"
|
||||
#include "cos.h"
|
||||
#include "tencode.h"
|
||||
#include "tglobal.h"
|
||||
#include "tmsg.h"
|
||||
#include "tstrbuild.h"
|
||||
#include "vnd.h"
|
||||
|
@ -1708,7 +1709,7 @@ _exit:
|
|||
atomic_add_fetch_64(&pVnode->statis.nInsertSuccess, pSubmitRsp->affectedRows);
|
||||
atomic_add_fetch_64(&pVnode->statis.nBatchInsert, 1);
|
||||
|
||||
if(pSubmitRsp->affectedRows > 0 && strlen(pOriginalMsg->info.conn.user) > 0){
|
||||
if(tsEnableMonitor && pSubmitRsp->affectedRows > 0 && strlen(pOriginalMsg->info.conn.user) > 0){
|
||||
const char *sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT_AFFECTED_ROWS, pVnode->monitor.strClusterId,
|
||||
pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId,
|
||||
pOriginalMsg->info.conn.user, "Success"};
|
||||
|
|
Loading…
Reference in New Issue