mirror of
https://gitee.com/openharmony/developtools_profiler
synced 2024-11-23 06:50:12 +00:00
同步黄区代码
Signed-off-by: frank-huangran <frank.huangran@huawei.com>
This commit is contained in:
parent
06c2ffaa86
commit
06e31708d0
@ -49,6 +49,15 @@ std::map<std::string, std::string> Temperature::ItemData()
|
|||||||
std::string temp;
|
std::string temp;
|
||||||
SPUtils::LoadFile(dirType, type);
|
SPUtils::LoadFile(dirType, type);
|
||||||
SPUtils::LoadFile(dirTemp, temp);
|
SPUtils::LoadFile(dirTemp, temp);
|
||||||
|
GetTempInfos(result, type, temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGD("Temperature::ItemData map size(%u)", result.size());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Temperature::GetTempInfos(std::map<std::string, std::string> &result, std::string type, std::string temp)
|
||||||
|
{
|
||||||
for (auto node : collectNodes) {
|
for (auto node : collectNodes) {
|
||||||
if (type.find(node) != std::string::npos) {
|
if (type.find(node) != std::string::npos) {
|
||||||
float t = SPUtilesTye::StringToSometype<float>(temp);
|
float t = SPUtilesTye::StringToSometype<float>(temp);
|
||||||
@ -59,10 +68,6 @@ std::map<std::string, std::string> Temperature::ItemData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
LOGD("Temperature::ItemData map size(%u)", result.size());
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@ void Heartbeat::HeartbeatRule()
|
|||||||
auto end = std::chrono::steady_clock::now();
|
auto end = std::chrono::steady_clock::now();
|
||||||
auto duration = std::chrono::duration_cast<std::chrono::seconds>(end - updateStart).count();
|
auto duration = std::chrono::duration_cast<std::chrono::seconds>(end - updateStart).count();
|
||||||
if (duration > timeout) {
|
if (duration > timeout) {
|
||||||
|
LOGI("Socket disconnected!")
|
||||||
KillSpId();
|
KillSpId();
|
||||||
}
|
}
|
||||||
sleep(checkMessageTime);
|
sleep(checkMessageTime);
|
||||||
|
@ -31,6 +31,7 @@ public:
|
|||||||
static Temperature instance;
|
static Temperature instance;
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
void GetTempInfos(std::map<std::string, std::string> &result, std::string type, std::string temp);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Temperature() {};
|
Temperature() {};
|
||||||
|
Loading…
Reference in New Issue
Block a user