function rename

This commit is contained in:
facetosea 2024-02-02 15:25:35 +08:00
parent a72593e66d
commit e0a1b886df
5 changed files with 15 additions and 15 deletions

View File

@ -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
}

View File

@ -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;
}
}

View File

@ -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.

View File

@ -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");
}
}

View File

@ -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");
}