mirror of https://github.com/milvus-io/milvus.git
MS-647 [monitor] grafana display average cpu-temp
Former-commit-id: e63179b6d3d27a8f9c3cd0103d8b1f6eeba238ddpull/191/head
parent
d482246191
commit
8a49d11d0d
|
@ -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
|
||||
|
|
|
@ -222,10 +222,19 @@ PrometheusMetrics::CPUTemperature() {
|
|||
|
||||
std::vector<float> 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
|
||||
|
|
Loading…
Reference in New Issue