Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
89b88caa
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
89b88caa
编写于
8月 09, 2021
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5681]<feature>:fix windows compilation error
上级
5e58304c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
27 addition
and
20 deletion
+27
-20
src/os/src/windows/wSysinfo.c
src/os/src/windows/wSysinfo.c
+8
-1
src/plugins/http/src/httpMetricsHandle.c
src/plugins/http/src/httpMetricsHandle.c
+19
-19
未找到文件。
src/os/src/windows/wSysinfo.c
浏览文件 @
89b88caa
...
...
@@ -115,7 +115,7 @@ static void taosGetSystemLocale() {
}
}
static
int32_t
taosGetCpuCores
()
{
int32_t
taosGetCpuCores
()
{
SYSTEM_INFO
info
;
GetSystemInfo
(
&
info
);
return
(
int32_t
)
info
.
dwNumberOfProcessors
;
...
...
@@ -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
)
{
*
bandSpeedKb
=
0
;
return
true
;
...
...
src/plugins/http/src/httpMetricsHandle.c
浏览文件 @
89b88caa
...
...
@@ -33,7 +33,7 @@ bool metricsProcessRequest(HttpContext* pContext) {
{
int32_t
dnodeId
=
dnodeGetDnodeId
();
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) {
int64_t
now
=
taosGetTimestampMs
();
int64_t
upTime
=
now
-
tsDnodeStartTime
;
char
*
keyUpTime
=
"up_time"
;
httpJsonPairInt64Val
(
jsonBuf
,
keyUpTime
,
strlen
(
keyUpTime
),
upTime
);
httpJsonPairInt64Val
(
jsonBuf
,
keyUpTime
,
(
int32_t
)
strlen
(
keyUpTime
),
upTime
);
}
}
{
int32_t
cpuCores
=
taosGetCpuCores
();
char
*
keyCpuCores
=
"cpu_cores"
;
httpJsonPairIntVal
(
jsonBuf
,
keyCpuCores
,
strlen
(
keyCpuCores
),
cpuCores
);
httpJsonPairIntVal
(
jsonBuf
,
keyCpuCores
,
(
int32_t
)
strlen
(
keyCpuCores
),
cpuCores
);
float
sysCpuUsage
=
0
;
float
procCpuUsage
=
0
;
...
...
@@ -61,8 +61,8 @@ bool metricsProcessRequest(HttpContext* pContext) {
}
char
*
keyCpuSystem
=
"cpu_system"
;
char
*
keyCpuEngine
=
"cpu_engine"
;
httpJsonPairFloatVal
(
jsonBuf
,
keyCpuSystem
,
strlen
(
keyCpuSystem
),
sysCpuUsage
);
httpJsonPairFloatVal
(
jsonBuf
,
keyCpuEngine
,
strlen
(
keyCpuEngine
),
procCpuUsage
);
httpJsonPairFloatVal
(
jsonBuf
,
keyCpuSystem
,
(
int32_t
)
strlen
(
keyCpuSystem
),
sysCpuUsage
);
httpJsonPairFloatVal
(
jsonBuf
,
keyCpuEngine
,
(
int32_t
)
strlen
(
keyCpuEngine
),
procCpuUsage
);
}
}
...
...
@@ -73,7 +73,7 @@ bool metricsProcessRequest(HttpContext* pContext) {
httpError
(
"failed to get sys memory info"
);
}
else
{
char
*
keyMemSystem
=
"mem_system"
;
httpJsonPairFloatVal
(
jsonBuf
,
keyMemSystem
,
strlen
(
keyMemSystem
),
sysMemoryUsedMB
);
httpJsonPairFloatVal
(
jsonBuf
,
keyMemSystem
,
(
int32_t
)
strlen
(
keyMemSystem
),
sysMemoryUsedMB
);
}
float
procMemoryUsedMB
=
0
;
...
...
@@ -82,7 +82,7 @@ bool metricsProcessRequest(HttpContext* pContext) {
httpError
(
"failed to get proc memory info"
);
}
else
{
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) {
}
else
{
char
*
keyNetIn
=
"net_in"
;
char
*
keyNetOut
=
"net_out"
;
httpJsonPairInt64Val
(
jsonBuf
,
keyNetIn
,
strlen
(
keyNetIn
),
rbytes
);
httpJsonPairInt64Val
(
jsonBuf
,
keyNetOut
,
strlen
(
keyNetOut
),
tbytes
);
httpJsonPairInt64Val
(
jsonBuf
,
keyNetIn
,
(
int32_t
)
strlen
(
keyNetIn
),
rbytes
);
httpJsonPairInt64Val
(
jsonBuf
,
keyNetOut
,
(
int32_t
)
strlen
(
keyNetOut
),
tbytes
);
}
}
...
...
@@ -108,8 +108,8 @@ bool metricsProcessRequest(HttpContext* pContext) {
}
else
{
char
*
keyIORead
=
"io_read"
;
char
*
keyIOWrite
=
"io_write"
;
httpJsonPairInt64Val
(
jsonBuf
,
keyIORead
,
strlen
(
keyIORead
),
rchars
);
httpJsonPairInt64Val
(
jsonBuf
,
keyIOWrite
,
strlen
(
keyIOWrite
),
wchars
);
httpJsonPairInt64Val
(
jsonBuf
,
keyIORead
,
(
int32_t
)
strlen
(
keyIORead
),
rchars
);
httpJsonPairInt64Val
(
jsonBuf
,
keyIOWrite
,
(
int32_t
)
strlen
(
keyIOWrite
),
wchars
);
}
}
...
...
@@ -121,18 +121,18 @@ bool metricsProcessRequest(HttpContext* pContext) {
{
char
*
keyDiskUsed
=
"disk_used"
;
char
*
keyDiskTotal
=
"disk_total"
;
httpJsonPairInt64Val
(
jsonBuf
,
keyDiskTotal
,
strlen
(
keyDiskTotal
),
fsMeta
.
tsize
);
httpJsonPairInt64Val
(
jsonBuf
,
keyDiskUsed
,
strlen
(
keyDiskUsed
),
fsMeta
.
used
);
httpJsonPairInt64Val
(
jsonBuf
,
keyDiskTotal
,
(
int32_t
)
strlen
(
keyDiskTotal
),
fsMeta
.
tsize
);
httpJsonPairInt64Val
(
jsonBuf
,
keyDiskUsed
,
(
int32_t
)
strlen
(
keyDiskUsed
),
fsMeta
.
used
);
char
*
keyDisks
=
"disks"
;
httpJsonPairHead
(
jsonBuf
,
keyDisks
,
strlen
(
keyDisks
));
httpJsonPairHead
(
jsonBuf
,
keyDisks
,
(
int32_t
)
strlen
(
keyDisks
));
httpJsonToken
(
jsonBuf
,
JsonArrStt
);
for
(
int
i
=
0
;
i
<
numTiers
;
++
i
)
{
httpJsonItemToken
(
jsonBuf
);
httpJsonToken
(
jsonBuf
,
JsonObjStt
);
char
*
keyDataDirLevelUsed
=
"datadir_used"
;
char
*
keyDataDirLevelTotal
=
"datadir_total"
;
httpJsonPairInt64Val
(
jsonBuf
,
keyDataDirLevelUsed
,
strlen
(
keyDataDirLevelUsed
),
tierMetas
[
i
].
used
);
httpJsonPairInt64Val
(
jsonBuf
,
keyDataDirLevelTotal
,
strlen
(
keyDataDirLevelTotal
),
tierMetas
[
i
].
size
);
httpJsonPairInt64Val
(
jsonBuf
,
keyDataDirLevelUsed
,
(
int32_t
)
strlen
(
keyDataDirLevelUsed
),
tierMetas
[
i
].
used
);
httpJsonPairInt64Val
(
jsonBuf
,
keyDataDirLevelTotal
,
(
int32_t
)
strlen
(
keyDataDirLevelTotal
),
tierMetas
[
i
].
size
);
httpJsonToken
(
jsonBuf
,
JsonObjEnd
);
}
httpJsonToken
(
jsonBuf
,
JsonArrEnd
);
...
...
@@ -146,9 +146,9 @@ bool metricsProcessRequest(HttpContext* pContext) {
char
*
keyReqHttp
=
"req_http"
;
char
*
keyReqSelect
=
"req_select"
;
char
*
keyReqInsert
=
"req_insert"
;
httpJsonPairInt64Val
(
jsonBuf
,
keyReqHttp
,
strlen
(
keyReqHttp
),
info
.
httpReqNum
);
httpJsonPairInt64Val
(
jsonBuf
,
keyReqSelect
,
strlen
(
keyReqSelect
),
info
.
queryReqNum
);
httpJsonPairInt64Val
(
jsonBuf
,
keyReqInsert
,
strlen
(
keyReqInsert
),
info
.
submitReqNum
);
httpJsonPairInt64Val
(
jsonBuf
,
keyReqHttp
,
(
int32_t
)
strlen
(
keyReqHttp
),
info
.
httpReqNum
);
httpJsonPairInt64Val
(
jsonBuf
,
keyReqSelect
,
(
int32_t
)
strlen
(
keyReqSelect
),
info
.
queryReqNum
);
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录