This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 171b229695 [IOTDB-5222] Fix the load of metric related configuration
(#8466)
171b229695 is described below
commit 171b229695eaba309912e5caee547c10d75b13dc
Author: ZhangHongYin <[email protected]>
AuthorDate: Fri Dec 16 10:39:07 2022 +0800
[IOTDB-5222] Fix the load of metric related configuration (#8466)
* Fix the load of metric related configuration
* Fix metric interface test
* Fix metric interface test
---
.../metrics/config/MetricConfigDescriptor.java | 16 +++++++------
.../iotdb/metrics/config/MetricConfigTest.java | 28 +++++++++++-----------
2 files changed, 23 insertions(+), 21 deletions(-)
diff --git
a/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfigDescriptor.java
b/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfigDescriptor.java
index ef28f8c779..e38085bb5e 100644
---
a/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfigDescriptor.java
+++
b/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfigDescriptor.java
@@ -112,33 +112,35 @@ public class MetricConfigDescriptor {
MetricConfig.IoTDBReporterConfig reporterConfig =
loadConfig.getIoTDBReporterConfig();
reporterConfig.setHost(
- getProperty("iotdb_reporter_host", reporterConfig.getHost(),
properties));
+ getProperty("metric_iotdb_reporter_host", reporterConfig.getHost(),
properties));
reporterConfig.setPort(
Integer.valueOf(
getProperty(
- "iotdb_reporter_port",
String.valueOf(reporterConfig.getPort()), properties)));
+ "metric_iotdb_reporter_port",
+ String.valueOf(reporterConfig.getPort()),
+ properties)));
reporterConfig.setUsername(
- getProperty("iotdb_reporter_username", reporterConfig.getUsername(),
properties));
+ getProperty("metric_iotdb_reporter_username",
reporterConfig.getUsername(), properties));
reporterConfig.setPassword(
- getProperty("iotdb_reporter_password", reporterConfig.getPassword(),
properties));
+ getProperty("metric_iotdb_reporter_password",
reporterConfig.getPassword(), properties));
reporterConfig.setMaxConnectionNumber(
Integer.valueOf(
getProperty(
- "iotdb_reporter_max_connection_number",
+ "metric_iotdb_reporter_max_connection_number",
String.valueOf(reporterConfig.getMaxConnectionNumber()),
properties)));
reporterConfig.setLocation(
- getProperty("iotdb_reporter_location", reporterConfig.getLocation(),
properties));
+ getProperty("metric_iotdb_reporter_location",
reporterConfig.getLocation(), properties));
reporterConfig.setPushPeriodInSecond(
Integer.valueOf(
getProperty(
- "iotdb_reporter_push_period",
+ "metric_iotdb_reporter_push_period",
String.valueOf(reporterConfig.getPushPeriodInSecond()),
properties)));
diff --git
a/metrics/interface/src/test/java/org/apache/iotdb/metrics/config/MetricConfigTest.java
b/metrics/interface/src/test/java/org/apache/iotdb/metrics/config/MetricConfigTest.java
index 8987d6997a..df749f2be0 100644
---
a/metrics/interface/src/test/java/org/apache/iotdb/metrics/config/MetricConfigTest.java
+++
b/metrics/interface/src/test/java/org/apache/iotdb/metrics/config/MetricConfigTest.java
@@ -40,13 +40,13 @@ public class MetricConfigTest {
properties.setProperty("cn_metric_level", "ALL");
properties.setProperty("cn_metric_async_collect_period", "10");
properties.setProperty("cn_metric_prometheus_reporter_port", "9090");
- properties.setProperty("cn_iotdb_reporter_host", "0.0.0.0");
- properties.setProperty("cn_iotdb_reporter_port", "6669");
- properties.setProperty("cn_iotdb_reporter_username", "user");
- properties.setProperty("cn_iotdb_reporter_password", "password");
- properties.setProperty("cn_iotdb_reporter_max_connection_number", "1");
- properties.setProperty("cn_iotdb_reporter_location", "metric");
- properties.setProperty("cn_iotdb_reporter_push_period", "5");
+ properties.setProperty("cn_metric_iotdb_reporter_host", "0.0.0.0");
+ properties.setProperty("cn_metric_iotdb_reporter_port", "6669");
+ properties.setProperty("cn_metric_iotdb_reporter_username", "user");
+ properties.setProperty("cn_metric_iotdb_reporter_password", "password");
+ properties.setProperty("cn_metric_iotdb_reporter_max_connection_number",
"1");
+ properties.setProperty("cn_metric_iotdb_reporter_location", "metric");
+ properties.setProperty("cn_metric_iotdb_reporter_push_period", "5");
MetricConfigDescriptor.getInstance().loadProps(properties);
@@ -79,13 +79,13 @@ public class MetricConfigTest {
properties.setProperty("dn_metric_level", "ALL");
properties.setProperty("dn_metric_async_collect_period", "10");
properties.setProperty("dn_metric_prometheus_reporter_port", "9090");
- properties.setProperty("dn_iotdb_reporter_host", "0.0.0.0");
- properties.setProperty("dn_iotdb_reporter_port", "6669");
- properties.setProperty("dn_iotdb_reporter_username", "user");
- properties.setProperty("dn_iotdb_reporter_password", "password");
- properties.setProperty("dn_iotdb_reporter_max_connection_number", "1");
- properties.setProperty("dn_iotdb_reporter_location", "metric");
- properties.setProperty("dn_iotdb_reporter_push_period", "5");
+ properties.setProperty("dn_metric_iotdb_reporter_host", "0.0.0.0");
+ properties.setProperty("dn_metric_iotdb_reporter_port", "6669");
+ properties.setProperty("dn_metric_iotdb_reporter_username", "user");
+ properties.setProperty("dn_metric_iotdb_reporter_password", "password");
+ properties.setProperty("dn_metric_iotdb_reporter_max_connection_number",
"1");
+ properties.setProperty("dn_metric_iotdb_reporter_location", "metric");
+ properties.setProperty("dn_metric_iotdb_reporter_push_period", "5");
properties.setProperty("dn_metric_internal_reporter_type", "IOTDB");
MetricConfigDescriptor.getInstance().loadProps(properties);