提交 89b88caa 编写于 作者: S shenglian zhou

[TD-5681]<feature>:fix windows compilation error

上级 5e58304c
...@@ -115,7 +115,7 @@ static void taosGetSystemLocale() { ...@@ -115,7 +115,7 @@ static void taosGetSystemLocale() {
} }
} }
static int32_t taosGetCpuCores() { int32_t taosGetCpuCores() {
SYSTEM_INFO info; SYSTEM_INFO info;
GetSystemInfo(&info); GetSystemInfo(&info);
return (int32_t)info.dwNumberOfProcessors; return (int32_t)info.dwNumberOfProcessors;
...@@ -146,6 +146,13 @@ int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize) { ...@@ -146,6 +146,13 @@ int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize) {
} }
} }
bool taosGetCardInfo(int64_t *bytes, int64_t *rbytes, int64_t *tbytes) {
if (bytes) *bytes = 0;
if (rbytes) *rbytes = 0;
if (tbytes) *tbytes = 0;
return true;
}
bool taosGetBandSpeed(float *bandSpeedKb) { bool taosGetBandSpeed(float *bandSpeedKb) {
*bandSpeedKb = 0; *bandSpeedKb = 0;
return true; return true;
......
...@@ -33,7 +33,7 @@ bool metricsProcessRequest(HttpContext* pContext) { ...@@ -33,7 +33,7 @@ bool metricsProcessRequest(HttpContext* pContext) {
{ {
int32_t dnodeId = dnodeGetDnodeId(); int32_t dnodeId = dnodeGetDnodeId();
char* keyDnodeId = "dnode_id"; char* keyDnodeId = "dnode_id";
httpJsonPairIntVal(jsonBuf, keyDnodeId, strlen(keyDnodeId), dnodeId); httpJsonPairIntVal(jsonBuf, keyDnodeId, (int32_t)strlen(keyDnodeId), dnodeId);
} }
{ {
...@@ -41,14 +41,14 @@ bool metricsProcessRequest(HttpContext* pContext) { ...@@ -41,14 +41,14 @@ bool metricsProcessRequest(HttpContext* pContext) {
int64_t now = taosGetTimestampMs(); int64_t now = taosGetTimestampMs();
int64_t upTime = now-tsDnodeStartTime; int64_t upTime = now-tsDnodeStartTime;
char* keyUpTime = "up_time"; char* keyUpTime = "up_time";
httpJsonPairInt64Val(jsonBuf, keyUpTime, strlen(keyUpTime), upTime); httpJsonPairInt64Val(jsonBuf, keyUpTime, (int32_t)strlen(keyUpTime), upTime);
} }
} }
{ {
int32_t cpuCores = taosGetCpuCores(); int32_t cpuCores = taosGetCpuCores();
char* keyCpuCores = "cpu_cores"; char* keyCpuCores = "cpu_cores";
httpJsonPairIntVal(jsonBuf, keyCpuCores, strlen(keyCpuCores), cpuCores); httpJsonPairIntVal(jsonBuf, keyCpuCores, (int32_t)strlen(keyCpuCores), cpuCores);
float sysCpuUsage = 0; float sysCpuUsage = 0;
float procCpuUsage = 0; float procCpuUsage = 0;
...@@ -61,8 +61,8 @@ bool metricsProcessRequest(HttpContext* pContext) { ...@@ -61,8 +61,8 @@ bool metricsProcessRequest(HttpContext* pContext) {
} }
char* keyCpuSystem = "cpu_system"; char* keyCpuSystem = "cpu_system";
char* keyCpuEngine = "cpu_engine"; char* keyCpuEngine = "cpu_engine";
httpJsonPairFloatVal(jsonBuf, keyCpuSystem, strlen(keyCpuSystem), sysCpuUsage); httpJsonPairFloatVal(jsonBuf, keyCpuSystem, (int32_t)strlen(keyCpuSystem), sysCpuUsage);
httpJsonPairFloatVal(jsonBuf, keyCpuEngine, strlen(keyCpuEngine), procCpuUsage); httpJsonPairFloatVal(jsonBuf, keyCpuEngine, (int32_t)strlen(keyCpuEngine), procCpuUsage);
} }
} }
...@@ -73,7 +73,7 @@ bool metricsProcessRequest(HttpContext* pContext) { ...@@ -73,7 +73,7 @@ bool metricsProcessRequest(HttpContext* pContext) {
httpError("failed to get sys memory info"); httpError("failed to get sys memory info");
} else { } else {
char* keyMemSystem = "mem_system"; char* keyMemSystem = "mem_system";
httpJsonPairFloatVal(jsonBuf, keyMemSystem, strlen(keyMemSystem), sysMemoryUsedMB); httpJsonPairFloatVal(jsonBuf, keyMemSystem, (int32_t)strlen(keyMemSystem), sysMemoryUsedMB);
} }
float procMemoryUsedMB = 0; float procMemoryUsedMB = 0;
...@@ -82,7 +82,7 @@ bool metricsProcessRequest(HttpContext* pContext) { ...@@ -82,7 +82,7 @@ bool metricsProcessRequest(HttpContext* pContext) {
httpError("failed to get proc memory info"); httpError("failed to get proc memory info");
} else { } else {
char* keyMemEngine = "mem_engine"; char* keyMemEngine = "mem_engine";
httpJsonPairFloatVal(jsonBuf, keyMemEngine, strlen(keyMemEngine), procMemoryUsedMB); httpJsonPairFloatVal(jsonBuf, keyMemEngine, (int32_t)strlen(keyMemEngine), procMemoryUsedMB);
} }
} }
...@@ -94,8 +94,8 @@ bool metricsProcessRequest(HttpContext* pContext) { ...@@ -94,8 +94,8 @@ bool metricsProcessRequest(HttpContext* pContext) {
} else { } else {
char* keyNetIn = "net_in"; char* keyNetIn = "net_in";
char* keyNetOut = "net_out"; char* keyNetOut = "net_out";
httpJsonPairInt64Val(jsonBuf, keyNetIn, strlen(keyNetIn), rbytes); httpJsonPairInt64Val(jsonBuf, keyNetIn, (int32_t)strlen(keyNetIn), rbytes);
httpJsonPairInt64Val(jsonBuf, keyNetOut, strlen(keyNetOut), tbytes); httpJsonPairInt64Val(jsonBuf, keyNetOut, (int32_t)strlen(keyNetOut), tbytes);
} }
} }
...@@ -108,8 +108,8 @@ bool metricsProcessRequest(HttpContext* pContext) { ...@@ -108,8 +108,8 @@ bool metricsProcessRequest(HttpContext* pContext) {
} else { } else {
char* keyIORead = "io_read"; char* keyIORead = "io_read";
char* keyIOWrite = "io_write"; char* keyIOWrite = "io_write";
httpJsonPairInt64Val(jsonBuf, keyIORead, strlen(keyIORead), rchars); httpJsonPairInt64Val(jsonBuf, keyIORead, (int32_t)strlen(keyIORead), rchars);
httpJsonPairInt64Val(jsonBuf, keyIOWrite, strlen(keyIOWrite), wchars); httpJsonPairInt64Val(jsonBuf, keyIOWrite, (int32_t)strlen(keyIOWrite), wchars);
} }
} }
...@@ -121,18 +121,18 @@ bool metricsProcessRequest(HttpContext* pContext) { ...@@ -121,18 +121,18 @@ bool metricsProcessRequest(HttpContext* pContext) {
{ {
char* keyDiskUsed = "disk_used"; char* keyDiskUsed = "disk_used";
char* keyDiskTotal = "disk_total"; char* keyDiskTotal = "disk_total";
httpJsonPairInt64Val(jsonBuf, keyDiskTotal, strlen(keyDiskTotal), fsMeta.tsize); httpJsonPairInt64Val(jsonBuf, keyDiskTotal, (int32_t)strlen(keyDiskTotal), fsMeta.tsize);
httpJsonPairInt64Val(jsonBuf, keyDiskUsed, strlen(keyDiskUsed), fsMeta.used); httpJsonPairInt64Val(jsonBuf, keyDiskUsed, (int32_t)strlen(keyDiskUsed), fsMeta.used);
char* keyDisks = "disks"; char* keyDisks = "disks";
httpJsonPairHead(jsonBuf, keyDisks, strlen(keyDisks)); httpJsonPairHead(jsonBuf, keyDisks, (int32_t)strlen(keyDisks));
httpJsonToken(jsonBuf, JsonArrStt); httpJsonToken(jsonBuf, JsonArrStt);
for (int i = 0; i < numTiers; ++i) { for (int i = 0; i < numTiers; ++i) {
httpJsonItemToken(jsonBuf); httpJsonItemToken(jsonBuf);
httpJsonToken(jsonBuf, JsonObjStt); httpJsonToken(jsonBuf, JsonObjStt);
char* keyDataDirLevelUsed = "datadir_used"; char* keyDataDirLevelUsed = "datadir_used";
char* keyDataDirLevelTotal = "datadir_total"; char* keyDataDirLevelTotal = "datadir_total";
httpJsonPairInt64Val(jsonBuf, keyDataDirLevelUsed, strlen(keyDataDirLevelUsed), tierMetas[i].used); httpJsonPairInt64Val(jsonBuf, keyDataDirLevelUsed, (int32_t)strlen(keyDataDirLevelUsed), tierMetas[i].used);
httpJsonPairInt64Val(jsonBuf, keyDataDirLevelTotal, strlen(keyDataDirLevelTotal), tierMetas[i].size); httpJsonPairInt64Val(jsonBuf, keyDataDirLevelTotal, (int32_t)strlen(keyDataDirLevelTotal), tierMetas[i].size);
httpJsonToken(jsonBuf, JsonObjEnd); httpJsonToken(jsonBuf, JsonObjEnd);
} }
httpJsonToken(jsonBuf, JsonArrEnd); httpJsonToken(jsonBuf, JsonArrEnd);
...@@ -146,9 +146,9 @@ bool metricsProcessRequest(HttpContext* pContext) { ...@@ -146,9 +146,9 @@ bool metricsProcessRequest(HttpContext* pContext) {
char* keyReqHttp = "req_http"; char* keyReqHttp = "req_http";
char* keyReqSelect = "req_select"; char* keyReqSelect = "req_select";
char* keyReqInsert = "req_insert"; char* keyReqInsert = "req_insert";
httpJsonPairInt64Val(jsonBuf, keyReqHttp, strlen(keyReqHttp), info.httpReqNum); httpJsonPairInt64Val(jsonBuf, keyReqHttp, (int32_t)strlen(keyReqHttp), info.httpReqNum);
httpJsonPairInt64Val(jsonBuf, keyReqSelect, strlen(keyReqSelect), info.queryReqNum); httpJsonPairInt64Val(jsonBuf, keyReqSelect, (int32_t)strlen(keyReqSelect), info.queryReqNum);
httpJsonPairInt64Val(jsonBuf, keyReqInsert, strlen(keyReqInsert), info.submitReqNum); httpJsonPairInt64Val(jsonBuf, keyReqInsert, (int32_t)strlen(keyReqInsert), info.submitReqNum);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册