From 09074384e9ba2e6d5259fbf8f4734483439b5877 Mon Sep 17 00:00:00 2001 From: yu yunfeng Date: Mon, 24 Jun 2019 19:52:31 +0800 Subject: [PATCH 1/4] comment unfixed function Former-commit-id: eef2587059cb8ca61e49870ba6488b8dd494f79e --- cpp/unittest/metrics/metrics_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/unittest/metrics/metrics_test.cpp b/cpp/unittest/metrics/metrics_test.cpp index 9a315f5557..004f0dc33d 100644 --- a/cpp/unittest/metrics/metrics_test.cpp +++ b/cpp/unittest/metrics/metrics_test.cpp @@ -33,7 +33,7 @@ TEST_F(DBTest, Metric_Tes) { server::Metrics::GetInstance().Init(); // server::PrometheusMetrics::GetInstance().exposer_ptr()->RegisterCollectable(server::PrometheusMetrics::GetInstance().registry_ptr()); - zilliz::milvus::cache::CpuCacheMgr::GetInstance()->SetCapacity(2UL*1024*1024*1024); + zilliz::milvus::cache::CpuCacheMgr::GetInstance()->SetCapacity(1UL*1024*1024*1024); std::cout<CacheCapacity()< Date: Wed, 26 Jun 2019 11:21:55 +0800 Subject: [PATCH 2/4] alter server_config Former-commit-id: abb109f62d540d3b0d1b53ae49308692a04e17af --- cpp/conf/server_config.yaml | 2 +- cpp/src/metrics/PrometheusMetrics.cpp | 3 ++- cpp/unittest/metrics/metrics_test.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/conf/server_config.yaml b/cpp/conf/server_config.yaml index 717e9b10cb..40ee6f2efa 100644 --- a/cpp/conf/server_config.yaml +++ b/cpp/conf/server_config.yaml @@ -12,7 +12,7 @@ db_config: index_building_threshold: 1024 #build index file when raw data file size larger than this value, unit: MB metric_config: - is_startup: true # true is on, false is off + is_startup: off # on is activated, otherwise is down. note: case sensitive collector: prometheus # prometheus, now we only have prometheus prometheus_config: collect_type: pull # pull means prometheus pull the message from server, push means server push metric to push gateway diff --git a/cpp/src/metrics/PrometheusMetrics.cpp b/cpp/src/metrics/PrometheusMetrics.cpp index 07e1d2ee71..d0d50800ad 100644 --- a/cpp/src/metrics/PrometheusMetrics.cpp +++ b/cpp/src/metrics/PrometheusMetrics.cpp @@ -17,7 +17,8 @@ ServerError PrometheusMetrics::Init() { try { ConfigNode &configNode = ServerConfig::GetInstance().GetConfig(CONFIG_METRIC); - startup_ = configNode.GetValue(CONFIG_METRIC_IS_STARTUP) == "true" ? true : false; + startup_ = configNode.GetValue(CONFIG_METRIC_IS_STARTUP) == "on"; + if(!startup_) return SERVER_SUCCESS; // Following should be read from config file. const std::string bind_address = configNode.GetChild(CONFIG_PROMETHEUS).GetValue(CONFIG_METRIC_PROMETHEUS_PORT); const std::string uri = std::string("/metrics"); diff --git a/cpp/unittest/metrics/metrics_test.cpp b/cpp/unittest/metrics/metrics_test.cpp index 00075fbb5f..72596dc79e 100644 --- a/cpp/unittest/metrics/metrics_test.cpp +++ b/cpp/unittest/metrics/metrics_test.cpp @@ -102,7 +102,7 @@ TEST_F(DBTest, Metric_Tes) { } }); - int loop = 10; + int loop = 10000; for (auto i=0; i Date: Wed, 26 Jun 2019 11:51:47 +0800 Subject: [PATCH 3/4] change CHANGELOG Former-commit-id: 02ccd2e584dad6754342da2170e40d5bbedfb4f7 --- cpp/CHANGELOG.md | 2 +- cpp/unittest/metrics/metrics_test.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index 0520eaf331..ca4e466cf9 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -20,7 +20,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-22 - Enhancement for MemVector size control - MS-92 - Unify behavior of debug and release build - MS-98 - Install all unit test to installation directory - +- MS-115 - Change is_startup of metric_config switch from true to on ## New Feature - MS-57 - Implement index load/search pipeline diff --git a/cpp/unittest/metrics/metrics_test.cpp b/cpp/unittest/metrics/metrics_test.cpp index 4346036efe..72596dc79e 100644 --- a/cpp/unittest/metrics/metrics_test.cpp +++ b/cpp/unittest/metrics/metrics_test.cpp @@ -30,7 +30,6 @@ TEST_F(DBTest, Metric_Tes) { server::SystemInfo::GetInstance().Init(); // server::Metrics::GetInstance().Init(); // server::Metrics::GetInstance().exposer_ptr()->RegisterCollectable(server::Metrics::GetInstance().registry_ptr()); - server::Metrics::GetInstance().Init(); // server::PrometheusMetrics::GetInstance().exposer_ptr()->RegisterCollectable(server::PrometheusMetrics::GetInstance().registry_ptr()); From a76e87112207c19cbe6345c8de0882852afcd217 Mon Sep 17 00:00:00 2001 From: yu yunfeng Date: Wed, 26 Jun 2019 11:54:51 +0800 Subject: [PATCH 4/4] off Former-commit-id: db7db3c0c5c14b962cf34dd1ad8e3801ce56084e --- cpp/conf/server_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/conf/server_config.yaml b/cpp/conf/server_config.yaml index 1c81a14c41..4ace334778 100644 --- a/cpp/conf/server_config.yaml +++ b/cpp/conf/server_config.yaml @@ -10,7 +10,7 @@ db_config: index_building_threshold: 1024 # index building trigger threshold, default: 1024, unit: MB metric_config: - is_startup: on # if monitoring start: on, off + is_startup: off # if monitoring start: on, off collector: prometheus # metrics collector: prometheus prometheus_config: # following are prometheus configure collect_type: pull # prometheus collect data method