From 8a49d11d0de827815cdb6fe73da011690087a7b0 Mon Sep 17 00:00:00 2001 From: Yu Kun Date: Mon, 14 Oct 2019 13:02:19 +0800 Subject: [PATCH 1/3] MS-647 [monitor] grafana display average cpu-temp Former-commit-id: e63179b6d3d27a8f9c3cd0103d8b1f6eeba238dd --- cpp/CHANGELOG.md | 1 + cpp/src/metrics/PrometheusMetrics.cpp | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index b8b854c258..5512f809c2 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -17,6 +17,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-640 - Cache object size calculate incorrect - MS-641 - Segment fault(signal 11) in PickToLoad - MS-639 - SQ8H index created failed and server hang +- MS-647 - [monitor] grafana display average cpu-temp ## Improvement - MS-552 - Add and change the easylogging library diff --git a/cpp/src/metrics/PrometheusMetrics.cpp b/cpp/src/metrics/PrometheusMetrics.cpp index 182f14d46c..dec7c264fd 100644 --- a/cpp/src/metrics/PrometheusMetrics.cpp +++ b/cpp/src/metrics/PrometheusMetrics.cpp @@ -222,10 +222,19 @@ PrometheusMetrics::CPUTemperature() { std::vector CPU_temperatures = server::SystemInfo::GetInstance().CPUTemperature(); + float avg_cpu_temp = 0; for (int i = 0; i < CPU_temperatures.size(); ++i) { - prometheus::Gauge& cpu_temp = CPU_temperature_.Add({{"CPU", std::to_string(i)}}); - cpu_temp.Set(CPU_temperatures[i]); + avg_cpu_temp += CPU_temperatures[i]; } + avg_cpu_temp /= CPU_temperatures.size(); + + prometheus::Gauge& cpu_temp = CPU_temperature_.Add({{"CPU", std::to_string(0)}}); + cpu_temp.Set(avg_cpu_temp); + +// for (int i = 0; i < CPU_temperatures.size(); ++i) { +// prometheus::Gauge& cpu_temp = CPU_temperature_.Add({{"CPU", std::to_string(i)}}); +// cpu_temp.Set(CPU_temperatures[i]); +// } } void From 31de75cd7f34437d40bdf9e10d66295964c64f10 Mon Sep 17 00:00:00 2001 From: Yu Kun Date: Mon, 14 Oct 2019 17:07:10 +0800 Subject: [PATCH 2/3] MS-644 - Search crashed with index-type: flat Former-commit-id: f9d38e6093357bfbb650487ca868b948f15b5656 --- .../scheduler/action/PushTaskToNeighbour.cpp | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/src/scheduler/action/PushTaskToNeighbour.cpp b/core/src/scheduler/action/PushTaskToNeighbour.cpp index b42234d0f6..7fbcf77afc 100644 --- a/core/src/scheduler/action/PushTaskToNeighbour.cpp +++ b/core/src/scheduler/action/PushTaskToNeighbour.cpp @@ -110,16 +110,18 @@ Action::DefaultLabelTaskScheduler(ResourceMgrWPtr res_mgr, ResourcePtr resource, bool moved = false; // to support test task, REFACTOR - if (auto index_engine = search_task->index_engine_) { - auto location = index_engine->GetLocation(); + if (resource->type() == ResourceType::CPU) { + if (auto index_engine = search_task->index_engine_) { + auto location = index_engine->GetLocation(); - for (auto i = 0; i < res_mgr.lock()->GetNumGpuResource(); ++i) { - auto index = milvus::cache::GpuCacheMgr::GetInstance(i)->GetIndex(location); - if (index != nullptr) { - moved = true; - auto dest_resource = res_mgr.lock()->GetResource(ResourceType::GPU, i); - PushTaskToResource(event->task_table_item_->task, dest_resource); - break; + for (auto i = 0; i < res_mgr.lock()->GetNumGpuResource(); ++i) { + auto index = milvus::cache::GpuCacheMgr::GetInstance(i)->GetIndex(location); + if (index != nullptr) { + moved = true; + auto dest_resource = res_mgr.lock()->GetResource(ResourceType::GPU, i); + PushTaskToResource(event->task_table_item_->task, dest_resource); + break; + } } } } From 6832422b2f9afa12a9c9d77f27d06ede09adc888 Mon Sep 17 00:00:00 2001 From: Yu Kun Date: Mon, 14 Oct 2019 17:07:33 +0800 Subject: [PATCH 3/3] MS-644 - Search crashed with index-type: flat Former-commit-id: e63705484e47811a611c6ffdd7ff8660577cd615 --- core/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index b4196eb6f1..8840fb2766 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -18,6 +18,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-641 - Segment fault(signal 11) in PickToLoad - MS-639 - SQ8H index created failed and server hang - MS-647 - [monitor] grafana display average cpu-temp +- MS-644 - Search crashed with index-type: flat ## Improvement - MS-552 - Add and change the easylogging library