提交 c816365e 编写于 作者: D dapan1121

fix bug

上级 9fe6d9c1
......@@ -67,6 +67,14 @@ float tsAvailLogDirGB = 0;
float tsMinimalLogDirGB = 1.0f;
int64_t asyncLogLostLines = 0;
int64_t dbgPostN = 0;
int64_t dbgNoPostN = 0;
int64_t dbgEmptyW = 0;
int64_t dbgW = 0;
int64_t dbgSmallW = 0;
int64_t dbgWSize = 0;
#ifdef _TD_POWER_
char tsLogDir[TSDB_FILENAME_LEN] = "/var/log/power";
#else
......@@ -581,6 +589,9 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, char *msg, int32_t msgLen)
if (w <= 0 || ((remainSize - msgLen - tmpBufLen) < (LOG_BUF_SIZE(tLogBuff) * 4 /5))) {
tsem_post(&(tLogBuff->buffNotEmpty));
dbgPostN++;
} else {
dbgNoPostN++;
}
pthread_mutex_unlock(&LOG_BUF_MUTEX(tLogBuff));
......@@ -630,9 +641,15 @@ static void *taosAsyncOutputLog(void *param) {
while (1) {
log_size = taosPollLogBuffer(tLogBuff, tempBuffer, TSDB_DEFAULT_LOG_BUF_SIZE);
if (log_size) {
dbgW++;
if (log_size < 1048576) {
dbgSmallW++;
}
dbgWSize+=log_size;
taosWrite(tLogBuff->fd, tempBuffer, log_size);
LOG_BUF_START(tLogBuff) = (LOG_BUF_START(tLogBuff) + log_size) % LOG_BUF_SIZE(tLogBuff);
} else {
dbgEmptyW++;
break;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册