Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
cf84c731
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cf84c731
编写于
10月 09, 2019
作者:
H
Heisenberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change perror into log
Former-commit-id: 073ad666010a9960ed238bd8df24ba2466749eba
上级
6a9af2f7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
6 deletion
+8
-6
cpp/CHANGELOG.md
cpp/CHANGELOG.md
+1
-0
cpp/src/metrics/SystemInfo.cpp
cpp/src/metrics/SystemInfo.cpp
+7
-6
未找到文件。
cpp/CHANGELOG.md
浏览文件 @
cf84c731
...
...
@@ -10,6 +10,7 @@ Please mark all change in change log and use the ticket from JIRA.
-
MS-577 - Unittest Query randomly hung
-
MS-587 - Count get wrong result after adding vectors and index built immediately
-
MS-599 - search wrong result when table created with metric_type: IP
-
MS-601 - Docker logs error caused by get CPUTemperature error
## Improvement
-
MS-552 - Add and change the easylogging library
...
...
cpp/src/metrics/SystemInfo.cpp
浏览文件 @
cf84c731
...
...
@@ -16,6 +16,7 @@
// under the License.
#include "metrics/SystemInfo.h"
#include "utils/Log.h"
#include <nvml.h>
#include <sys/types.h>
...
...
@@ -63,12 +64,12 @@ SystemInfo::Init() {
nvmlReturn_t
nvmlresult
;
nvmlresult
=
nvmlInit
();
if
(
NVML_SUCCESS
!=
nvmlresult
)
{
printf
(
"System information initilization failed"
)
;
SERVER_LOG_ERROR
<<
"System information initilization failed"
;
return
;
}
nvmlresult
=
nvmlDeviceGetCount
(
&
num_device_
);
if
(
NVML_SUCCESS
!=
nvmlresult
)
{
printf
(
"Unable to get devidce number"
)
;
SERVER_LOG_ERROR
<<
"Unable to get devidce number"
;
return
;
}
...
...
@@ -154,7 +155,7 @@ SystemInfo::getTotalCpuTime(std::vector<uint64_t>& work_time_array) {
std
::
vector
<
uint64_t
>
total_time_array
;
FILE
*
file
=
fopen
(
"/proc/stat"
,
"r"
);
if
(
file
==
NULL
)
{
perror
(
"Could not open stat file"
)
;
SERVER_LOG_ERROR
<<
"Could not open stat file"
;
return
total_time_array
;
}
...
...
@@ -165,7 +166,7 @@ SystemInfo::getTotalCpuTime(std::vector<uint64_t>& work_time_array) {
char
buffer
[
1024
];
char
*
ret
=
fgets
(
buffer
,
sizeof
(
buffer
)
-
1
,
file
);
if
(
ret
==
NULL
)
{
perror
(
"Could not read stat file"
)
;
SERVER_LOG_ERROR
<<
"Could not read stat file"
;
fclose
(
file
);
return
total_time_array
;
}
...
...
@@ -245,7 +246,7 @@ SystemInfo::CPUTemperature() {
DIR
*
dir
=
NULL
;
dir
=
opendir
(
path
.
c_str
());
if
(
!
dir
)
{
perror
(
"opendir"
)
;
SERVER_LOG_ERROR
<<
"Could not open hwmon directory"
;
return
result
;
}
...
...
@@ -262,7 +263,7 @@ SystemInfo::CPUTemperature() {
object
+=
"/temp1_input"
;
FILE
*
file
=
fopen
(
object
.
c_str
(),
"r"
);
if
(
file
==
nullptr
)
{
perror
(
"Could not open temperature file"
);
SERVER_LOG_ERROR
<<
"Could not open temperature file"
exit
(
1
);
}
float
temp
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录