winlin

rename network_device_index to network

@@ -90,7 +90,7 @@ stats { @@ -90,7 +90,7 @@ stats {
90 network 0; 90 network 0;
91 # the device name to stat the disk iops. 91 # the device name to stat the disk iops.
92 # ignore the device of /proc/diskstats if not configed. 92 # ignore the device of /proc/diskstats if not configed.
93 - disk_device_name sda sdb xvda xvdb; 93 + disk sda sdb xvda xvdb;
94 } 94 }
95 95
96 ############################################################################################# 96 #############################################################################################
@@ -1249,7 +1249,7 @@ int SrsConfig::check_config() @@ -1249,7 +1249,7 @@ int SrsConfig::check_config()
1249 SrsConfDirective* conf = get_stats(); 1249 SrsConfDirective* conf = get_stats();
1250 for (int i = 0; conf && i < (int)conf->directives.size(); i++) { 1250 for (int i = 0; conf && i < (int)conf->directives.size(); i++) {
1251 string n = conf->at(i)->name; 1251 string n = conf->at(i)->name;
1252 - if (n != "network" && n != "disk_device_name") { 1252 + if (n != "network" && n != "disk") {
1253 ret = ERROR_SYSTEM_CONFIG_INVALID; 1253 ret = ERROR_SYSTEM_CONFIG_INVALID;
1254 srs_error("unsupported stats directive %s, ret=%d", n.c_str(), ret); 1254 srs_error("unsupported stats directive %s, ret=%d", n.c_str(), ret);
1255 return ret; 1255 return ret;
@@ -3202,7 +3202,7 @@ SrsConfDirective* SrsConfig::get_stats_disk_device() @@ -3202,7 +3202,7 @@ SrsConfDirective* SrsConfig::get_stats_disk_device()
3202 return NULL; 3202 return NULL;
3203 } 3203 }
3204 3204
3205 - conf = conf->get("disk_device_name"); 3205 + conf = conf->get("disk");
3206 if (!conf || conf->args.size() == 0) { 3206 if (!conf || conf->args.size() == 0) {
3207 return NULL; 3207 return NULL;
3208 } 3208 }
@@ -158,7 +158,7 @@ std::string __full_conf = "" @@ -158,7 +158,7 @@ std::string __full_conf = ""
158 " network 0; \n" 158 " network 0; \n"
159 " # the device name to stat the disk iops. \n" 159 " # the device name to stat the disk iops. \n"
160 " # ignore the device of /proc/diskstats if not configed. \n" 160 " # ignore the device of /proc/diskstats if not configed. \n"
161 - " disk_device_name sda sdb xvda xvdb; \n" 161 + " disk sda sdb xvda xvdb; \n"
162 "} \n" 162 "} \n"
163 " \n" 163 " \n"
164 "############################################################################################# \n" 164 "############################################################################################# \n"
@@ -4642,12 +4642,12 @@ VOID TEST(ConfigMainTest, CheckConf_stats) @@ -4642,12 +4642,12 @@ VOID TEST(ConfigMainTest, CheckConf_stats)
4642 4642
4643 if (true) { 4643 if (true) {
4644 MockSrsConfig conf; 4644 MockSrsConfig conf;
4645 - EXPECT_TRUE(ERROR_SUCCESS == conf.parse(_MIN_OK_CONF"stats{disk_device_name sda;}")); 4645 + EXPECT_TRUE(ERROR_SUCCESS == conf.parse(_MIN_OK_CONF"stats{disk sda;}"));
4646 } 4646 }
4647 4647
4648 if (true) { 4648 if (true) {
4649 MockSrsConfig conf; 4649 MockSrsConfig conf;
4650 - EXPECT_TRUE(ERROR_SUCCESS != conf.parse(_MIN_OK_CONF"stats{disk_device_names sda;}")); 4650 + EXPECT_TRUE(ERROR_SUCCESS != conf.parse(_MIN_OK_CONF"stats{disks sda;}"));
4651 } 4651 }
4652 } 4652 }
4653 4653