fix:[TS-4921]refactor reporting logic for slow log
This commit is contained in:
parent
8db6a395aa
commit
522deafed5
|
@ -157,7 +157,10 @@ static void generateWriteSlowLog(STscObj *pTscObj, SRequestObj *pRequest, int32_
|
|||
}
|
||||
|
||||
char* value = cJSON_PrintUnformatted(json);
|
||||
MonitorSlowLogData data = {.clusterId = pTscObj->pAppInfo->clusterId, .type = SLOW_LOG_WRITE, .data = value};
|
||||
MonitorSlowLogData data = {0};
|
||||
data.clusterId = pTscObj->pAppInfo->clusterId;
|
||||
data.type = SLOW_LOG_WRITE;
|
||||
data.data = value;
|
||||
if(monitorPutData2MonitorQueue(data) < 0){
|
||||
taosMemoryFree(value);
|
||||
}
|
||||
|
|
|
@ -547,7 +547,6 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
|
|||
}
|
||||
|
||||
SAppInstInfo *pInst = pAppHbMgr->pAppInstInfo;
|
||||
int32_t oldInterval = pInst->monitorParas.tsMonitorInterval;
|
||||
pInst->monitorParas = pRsp.monitorParas;
|
||||
tscDebug("[monitor] paras from hb, clusterId:%" PRIx64 " monitorParas threshold:%d scope:%d",
|
||||
pInst->clusterId, pRsp.monitorParas.tsSlowLogThreshold, pRsp.monitorParas.tsSlowLogScope);
|
||||
|
|
|
@ -155,7 +155,9 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
if(taosHashPut(appInfo.pInstMapByClusterId, &connectRsp.clusterId, LONG_BYTES, &pTscObj->pAppInfo, POINTER_BYTES) != 0){
|
||||
tscError("failed to put appInfo into appInfo.pInstMapByClusterId");
|
||||
}
|
||||
MonitorSlowLogData data ={.clusterId = pTscObj->pAppInfo->clusterId, .type = SLOW_LOG_READ_BEGINNIG, .pFile = NULL, .data = NULL};
|
||||
MonitorSlowLogData data = {0};
|
||||
data.clusterId = pTscObj->pAppInfo->clusterId;
|
||||
data.type = SLOW_LOG_READ_BEGINNIG;
|
||||
monitorPutData2MonitorQueue(data);
|
||||
monitorClientSlowQueryInit(connectRsp.clusterId);
|
||||
monitorClientSQLReqInit(connectRsp.clusterId);
|
||||
|
|
Loading…
Reference in New Issue