清理告警

Signed-off-by: j00383476 <jinhai2@huawei.com>
This commit is contained in:
j00383476 2024-07-03 12:04:13 +08:00
parent 2eeefa3659
commit 4b1e00fb40
5 changed files with 21 additions and 14 deletions

View File

@ -79,7 +79,7 @@ std::string ControlCallCmd::GetResult(std::vector<std::string> v)
}
return result;
}
std::string ControlCallCmd::TimeDelay()
std::string ControlCallCmd::TimeDelay() const
{
OHOS::SmartPerf::ParseClickResponseTrace pcrt;
OHOS::SmartPerf::StartUpDelay sd;
@ -94,15 +94,15 @@ std::string ControlCallCmd::TimeDelay()
std::promise<std::string> promComplete;
std::promise<std::string> promRadarFrame;
std::future<std::string> futureResponse = promResponse.get_future();
std::thread([promResponse = std::move(promResponse)]() mutable {
std::thread([&promResponse = promResponse]() mutable {
promResponse.set_value(SPUtils::GetRadarResponse());
}).detach();
std::future<std::string> futureComplete = promComplete.get_future();
std::thread([promComplete = std::move(promComplete)]() mutable {
std::thread([&promComplete = promComplete]() mutable {
promComplete.set_value(SPUtils::GetRadarComplete());
}).detach();
std::future<std::string> futureRadarFrame = promRadarFrame.get_future();
std::thread([promRadarFrame = std::move(promRadarFrame)]() mutable {
std::thread([&promRadarFrame = promRadarFrame]() mutable {
promRadarFrame.set_value(SPUtils::GetRadarFrame());
}).detach();
std::string responseStr = futureResponse.get();
@ -126,7 +126,7 @@ std::string ControlCallCmd::TimeDelay()
resultTime = resultTime + hitchTimeRate + maxFrame;
return resultTime;
}
std::string ControlCallCmd::SlideList()
std::string ControlCallCmd::SlideList() const
{
OHOS::SmartPerf::ParseClickResponseTrace pcrt;
OHOS::SmartPerf::StartUpDelay sd;
@ -147,11 +147,11 @@ std::string ControlCallCmd::SlideList()
std::promise<std::string> promResponse;
std::promise<std::string> promRadarFrame;
std::future<std::string> futureResponse = promResponse.get_future();
std::thread([promResponse = std::move(promResponse)]() mutable {
std::thread([&promResponse = promResponse]() mutable {
promResponse.set_value(SPUtils::GetRadarResponse());
}).detach();
std::future<std::string> futureRadarFrame = promRadarFrame.get_future();
std::thread([promRadarFrame = std::move(promRadarFrame)]() mutable {
std::thread([&promRadarFrame = promRadarFrame]() mutable {
promRadarFrame.set_value(SPUtils::GetRadarFrame());
}).detach();
std::string responseStr = futureResponse.get();
@ -330,14 +330,15 @@ std::string ControlCallCmd::GetAppStartTime() const
std::string traceName = std::string("/data/local/tmp/") + std::string("sp_trace_") + "start" + ".ftrace";
std::thread thGetTrace = std::thread([&sd, traceName]() { sd.GetTrace("start", traceName); });
std::thread thGetHisysId = std::thread([&sd]() { sd.GetHisysIdAndKill(); });
std::promise<std::string> promRadar;
std::promise<std::string> promRadarFrame;
std::future<std::string> futureRadar = promRadar.get_future();
std::thread([promRadar = std::move(promRadar)]() mutable {
std::thread([&promRadar = promRadar]() mutable {
promRadar.set_value(SPUtils::GetRadar());
}).detach();
std::future<std::string> futureRadarFrame = promRadarFrame.get_future();
std::thread([promRadarFrame = std::move(promRadarFrame)]() mutable {
std::thread([&promRadarFrame = promRadarFrame]() mutable {
promRadarFrame.set_value(SPUtils::GetRadarFrame());
}).detach();
std::string radarStr = futureRadar.get();
@ -353,6 +354,12 @@ std::string ControlCallCmd::GetAppStartTime() const
std::string ssResult = ss.str();
std::string hitchTimeRate = "HitchTimeRate:" + ssResult + "ms/s \n";
resultStream = resultStream + hitchTimeRate + resultStream2;
std::promise<std::string> promResponse;
std::future<std::string> futureResponse = promResponse.get_future();
std::thread([&promResponse = promResponse]() mutable {
promResponse.set_value(SPUtils::GetRadarResponse());
}).detach();
std::string responseStr = futureResponse.get();
return resultStream;
}
double ControlCallCmd::ColdStart(std::vector<std::string> v)

View File

@ -33,8 +33,8 @@ public:
std::string GetResult(std::vector<std::string> v);
std::string GetFrame();
std::string GetAppStartTime() const;
std::string SlideList();
std::string TimeDelay();
std::string SlideList() const;
std::string TimeDelay() const;
private:
bool isOhTest = false;

View File

@ -68,7 +68,7 @@ public:
void HandleCommand(std::string argStr, const std::string &argStr1);
int GetItemInfo(std::multimap<std::string, std::string, decltype(SPUtils::Cmp) *> &spMap);
void PrintfExecCommand(const std::map<std::string, std::string> data) const;
void PrintMap(std::multimap<std::string, std::string, decltype(SPUtils::Cmp) *> &spMap, int index);
void PrintMap(std::multimap<std::string, std::string, decltype(SPUtils::Cmp) *> &spMap, int index) const;
// 采集次数
int num = 0;
// 包名

View File

@ -106,7 +106,7 @@ std::string navigation::GetWinId(std::string processId) const
params[paramThree].find("WinId") != std::string::npos) {
continue;
}
if (params.size() > paramTwentyFour) {
if (static_cast<int>(params.size()) > paramTwentyFour) {
DumpEntity dumpEntity { params[2], params[3] };
dumpEntityList.push_back(dumpEntity);
}

View File

@ -227,7 +227,7 @@ void SmartPerfCommand::PrintfExecCommand(const std::map<std::string, std::string
}
void SmartPerfCommand::PrintMap(std::multimap<std::string, std::string,
decltype(SPUtils::Cmp) *> &spMap, int index)
decltype(SPUtils::Cmp) *> &spMap, int index) const
{
int i = 0;
for (auto iter = spMap.cbegin(); iter != spMap.cend(); ++iter) {