Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-07-27 18:40:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6f700f3f405d5b062b1d99d51d542fac005e7b41
6f700f3f
1 parent
f4ea48ad
rename network_device_index to network
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
6 行增加
和
6 行删除
trunk/conf/full.conf
trunk/src/app/srs_app_config.cpp
trunk/src/utest/srs_utest_config.cpp
trunk/conf/full.conf
查看文件 @
6f700f3
...
...
@@ -90,7 +90,7 @@ stats {
network
0
;
# the device name to stat the disk iops.
# ignore the device of /proc/diskstats if not configed.
disk
_device_name
sda
sdb
xvda
xvdb
;
disk
sda
sdb
xvda
xvdb
;
}
#############################################################################################
...
...
trunk/src/app/srs_app_config.cpp
查看文件 @
6f700f3
...
...
@@ -1249,7 +1249,7 @@ int SrsConfig::check_config()
SrsConfDirective
*
conf
=
get_stats
();
for
(
int
i
=
0
;
conf
&&
i
<
(
int
)
conf
->
directives
.
size
();
i
++
)
{
string
n
=
conf
->
at
(
i
)
->
name
;
if
(
n
!=
"network"
&&
n
!=
"disk
_device_name
"
)
{
if
(
n
!=
"network"
&&
n
!=
"disk"
)
{
ret
=
ERROR_SYSTEM_CONFIG_INVALID
;
srs_error
(
"unsupported stats directive %s, ret=%d"
,
n
.
c_str
(),
ret
);
return
ret
;
...
...
@@ -3202,7 +3202,7 @@ SrsConfDirective* SrsConfig::get_stats_disk_device()
return
NULL
;
}
conf
=
conf
->
get
(
"disk
_device_name
"
);
conf
=
conf
->
get
(
"disk"
);
if
(
!
conf
||
conf
->
args
.
size
()
==
0
)
{
return
NULL
;
}
...
...
trunk/src/utest/srs_utest_config.cpp
查看文件 @
6f700f3
...
...
@@ -158,7 +158,7 @@ std::string __full_conf = ""
" network 0;
\n
"
" # the device name to stat the disk iops.
\n
"
" # ignore the device of /proc/diskstats if not configed.
\n
"
" disk
_device_name
sda sdb xvda xvdb;
\n
"
" disk sda sdb xvda xvdb;
\n
"
"}
\n
"
"
\n
"
"#############################################################################################
\n
"
...
...
@@ -4642,12 +4642,12 @@ VOID TEST(ConfigMainTest, CheckConf_stats)
if
(
true
)
{
MockSrsConfig
conf
;
EXPECT_TRUE
(
ERROR_SUCCESS
==
conf
.
parse
(
_MIN_OK_CONF
"stats{disk
_device_name
sda;}"
));
EXPECT_TRUE
(
ERROR_SUCCESS
==
conf
.
parse
(
_MIN_OK_CONF
"stats{disk sda;}"
));
}
if
(
true
)
{
MockSrsConfig
conf
;
EXPECT_TRUE
(
ERROR_SUCCESS
!=
conf
.
parse
(
_MIN_OK_CONF
"stats{disk
_device_name
s sda;}"
));
EXPECT_TRUE
(
ERROR_SUCCESS
!=
conf
.
parse
(
_MIN_OK_CONF
"stats{disks sda;}"
));
}
}
...
...
请
注册
或
登录
后发表评论