From cd4561923a1ac15ff5ad057b2c26b4d833c819e1 Mon Sep 17 00:00:00 2001 From: starlord Date: Wed, 9 Oct 2019 17:51:01 +0800 Subject: [PATCH] format code Former-commit-id: 162d51623727cf2f655ff54080daf3bc18e02f07 --- cpp/src/metrics/SystemInfo.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cpp/src/metrics/SystemInfo.cpp b/cpp/src/metrics/SystemInfo.cpp index bf2b0407a9..154f7b0797 100644 --- a/cpp/src/metrics/SystemInfo.cpp +++ b/cpp/src/metrics/SystemInfo.cpp @@ -18,16 +18,16 @@ #include "metrics/SystemInfo.h" #include "utils/Log.h" +#include #include +#include +#include #include #include #include #include #include #include -#include -#include -#include namespace milvus { namespace server { @@ -64,7 +64,7 @@ SystemInfo::Init() { nvmlReturn_t nvmlresult; nvmlresult = nvmlInit(); if (NVML_SUCCESS != nvmlresult) { - SERVER_LOG_ERROR << "System information initilization failed"; + SERVER_LOG_ERROR << "System information initilization failed"; return; } nvmlresult = nvmlDeviceGetCount(&num_device_); @@ -243,14 +243,14 @@ SystemInfo::CPUTemperature() { std::vector result; std::string path = "/sys/class/hwmon/"; - DIR *dir = NULL; + DIR* dir = NULL; dir = opendir(path.c_str()); if (!dir) { SERVER_LOG_ERROR << "Could not open hwmon directory"; return result; } - struct dirent *ptr = NULL; + struct dirent* ptr = NULL; while ((ptr = readdir(dir)) != NULL) { std::string filename(path); filename.append(ptr->d_name); @@ -261,7 +261,7 @@ SystemInfo::CPUTemperature() { if (m.find("coretemp") != std::string::npos) { std::string object = filename; object += "/temp1_input"; - FILE *file = fopen(object.c_str(), "r"); + FILE* file = fopen(object.c_str(), "r"); if (file == nullptr) { SERVER_LOG_ERROR << "Could not open temperature file"; return result;