diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h index 257ee35aaf..8fe717a7fa 100644 --- a/source/client/inc/clientInt.h +++ b/source/client/inc/clientInt.h @@ -431,11 +431,11 @@ void freeQueryParam(SSyncQueryParam* param); int32_t clientParseSqlImpl(void* param, const char* dbName, const char* sql, bool parseOnly, const char* effeciveUser, SParseSqlRes* pRes); #endif -void clusterSlowQueryMonitorInit(const char* clusterKey); +void clientSlowQueryMonitorInit(const char* clusterKey); void SlowQueryLog(int64_t rid, bool killed, int32_t code, int32_t cost); -void clusterSelectMonitorInit(const char* clusterKey); -void selectLog(int64_t rid, bool killed, int32_t code); +void clientSQLReqMonitorInit(const char* clusterKey); +void sqlReqLog(int64_t rid, bool killed, int32_t code); #ifdef __cplusplus } diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index bd83f15e7e..d5523d6d7e 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -105,7 +105,7 @@ static void deregisterRequest(SRequestObj *pRequest) { pRequest->metric.planCostUs, pRequest->metric.execCostUs); atomic_add_fetch_64((int64_t *)&pActivity->queryElapsedTime, duration); - selectLog(pTscObj->id, pRequest->killed, pRequest->code); + sqlReqLog(pTscObj->id, pRequest->killed, pRequest->code); reqType = SLOW_LOG_TYPE_QUERY; } } diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index a165ef6e88..200a940924 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -159,8 +159,8 @@ STscObj* taos_connect_internal(const char* ip, const char* user, const char* pas pInst = &p; - clusterSlowQueryMonitorInit(p->instKey); - clusterSelectMonitorInit(p->instKey); + clientSlowQueryMonitorInit(p->instKey); + clientSQLReqMonitorInit(p->instKey); } else { ASSERTS((*pInst) && (*pInst)->pAppHbMgr, "*pInst:%p, pAppHgMgr:%p", *pInst, (*pInst) ? (*pInst)->pAppHbMgr : NULL); // reset to 0 in case of conn with duplicated user key but its user has ever been dropped. diff --git a/source/client/src/clientSqlMonitor.c b/source/client/src/clientSqlMonitor.c index 85458b6960..80375bafae 100644 --- a/source/client/src/clientSqlMonitor.c +++ b/source/client/src/clientSqlMonitor.c @@ -24,7 +24,7 @@ const char* selectMonitorLabels[] = {"cluster_id", "sql_type", "username", "resu static const char* defaultClusterID = ""; -void clusterSelectMonitorInit(const char* clusterKey) { +void clientSQLReqMonitorInit(const char* clusterKey) { if (!tsEnableMonitor) return; SAppInstInfo* pAppInstInfo = getAppInstInfo(clusterKey); SEpSet epSet = getEpSet_s(&pAppInstInfo->mgmtEp); @@ -32,12 +32,12 @@ void clusterSelectMonitorInit(const char* clusterKey) { createClusterCounter(clusterKey, selectMonitorName, selectMonitorHelp, selectMonitorLabelCount, selectMonitorLabels); } -void clusterSelectLog(const char* clusterKey, const char* user, SQL_RESULT_CODE result) { +void clientSQLReqLog(const char* clusterKey, const char* user, SQL_RESULT_CODE result) { const char* selectMonitorLabelValues[] = {defaultClusterID, "select", user, resultStr(result)}; taosClusterCounterInc(clusterKey, selectMonitorName, selectMonitorLabelValues); } -void selectLog(int64_t rid, bool killed, int32_t code) { +void sqlReqLog(int64_t rid, bool killed, int32_t code) { if (!tsEnableMonitor) return; SQL_RESULT_CODE result = SQL_RESULT_SUCCESS; if (TSDB_CODE_SUCCESS != code) { @@ -51,10 +51,10 @@ void selectLog(int64_t rid, bool killed, int32_t code) { STscObj* pTscObj = acquireTscObj(rid); if (pTscObj != NULL) { if (pTscObj->pAppInfo == NULL) { - tscLog("selectLog, not found pAppInfo"); + tscLog("sqlReqLog, not found pAppInfo"); } - return clusterSelectLog(pTscObj->pAppInfo->instKey, pTscObj->user, result); + return clientSQLReqLog(pTscObj->pAppInfo->instKey, pTscObj->user, result); } else { - tscLog("selectLog, not found rid"); + tscLog("sqlReqLog, not found rid"); } } diff --git a/source/client/src/slowQueryMonitor.c b/source/client/src/slowQueryMonitor.c index 98785205b9..c4c623c7be 100644 --- a/source/client/src/slowQueryMonitor.c +++ b/source/client/src/slowQueryMonitor.c @@ -41,7 +41,7 @@ static const char* getSlowQueryLableCostDesc(int64_t cost) { return "< 3 s"; } -void clusterSlowQueryMonitorInit(const char* clusterKey) { +void clientSlowQueryMonitorInit(const char* clusterKey) { if (!tsEnableMonitor || !enableSlowQueryMonitor) return; SAppInstInfo* pAppInstInfo = getAppInstInfo(clusterKey); SEpSet epSet = getEpSet_s(&pAppInstInfo->mgmtEp); @@ -49,7 +49,7 @@ void clusterSlowQueryMonitorInit(const char* clusterKey) { createClusterCounter(clusterKey, slowQueryName, slowQueryHelp, slowQueryLabelCount, slowQueryLabels); } -void clusterSlowQueryLog(const char* clusterKey, const char* user, SQL_RESULT_CODE result, int32_t cost) { +void clientSlowQueryLog(const char* clusterKey, const char* user, SQL_RESULT_CODE result, int32_t cost) { const char* slowQueryLabelValues[] = {defaultClusterID, user, resultStr(result), getSlowQueryLableCostDesc(cost)}; taosClusterCounterInc(clusterKey, slowQueryName, slowQueryLabelValues); } @@ -70,7 +70,7 @@ void SlowQueryLog(int64_t rid, bool killed, int32_t code, int32_t cost) { if(pTscObj->pAppInfo == NULL) { tscLog("SlowQueryLog, not found pAppInfo"); } - return clusterSlowQueryLog(pTscObj->pAppInfo->instKey, pTscObj->user, result, cost); + return clientSlowQueryLog(pTscObj->pAppInfo->instKey, pTscObj->user, result, cost); } else { tscLog("SlowQueryLog, not found rid"); }