You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2022/12/18 05:09:16 UTC
[iotdb] branch rel/1.0 updated: [IOTDB-5222] Fix the load of metric related configuration (#8466) (#8493)
This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch rel/1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.0 by this push:
new 8091e3de6d [IOTDB-5222] Fix the load of metric related configuration (#8466) (#8493)
8091e3de6d is described below
commit 8091e3de6d4bb9c2c431eafc0fa850e4447851c7
Author: ZhangHongYin <46...@users.noreply.github.com>
AuthorDate: Sun Dec 18 13:09:10 2022 +0800
[IOTDB-5222] Fix the load of metric related configuration (#8466) (#8493)
* Fix the load of metric related configuration
* Fix metric interface test
* Fix metric interface test
(cherry picked from commit 171b229695eaba309912e5caee547c10d75b13dc)
---
.../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);