清理告警

Signed-off-by: j00383476 <jinhai2@huawei.com>
This commit is contained in:
j00383476 2024-04-18 15:56:28 +08:00
parent 89207c9a98
commit caca030f00
9 changed files with 49 additions and 48 deletions

View File

@ -66,7 +66,7 @@ std::map<std::string, std::string> FPS::ItemData()
}
}
SetFpsCurrentFpsTime(fpsInfoResult);
SetFpsCurrentFpsTime(fpsInfoResult);s
LOGI("FPS::ItemData map size(%u)", result.size());
return result;

View File

@ -40,7 +40,7 @@ std::map<std::string, std::string> MEMORY::ItemData()
return result;
}
void MEMORY::SetPackageName(std::string pName)
void MEMORY::SetPackageName(const std::string pName)
{
packageName = pName;
}
@ -148,17 +148,17 @@ std::map<std::string, std::string> MEMORY::GetPssRamInfo(FILE *fd, std::vector<s
std::map<std::string, std::string> MEMORY::SaveSumRamInfo(std::vector<std::string> paramsInfo) const
{
std::map<std::string, std::string> sumRamInfo;
if (paramsInfo.size() > 0) {
sumRamInfo["sharedClean"] = paramsInfo[MEMORY_SECOND];
sumRamInfo["sharedDirty"] = paramsInfo[MEMORY_THIRD];
sumRamInfo["privateClean"] = paramsInfo[MEMORY_FOURTH];
sumRamInfo["privateDirty"] = paramsInfo[MEMORY_FIFTH];
sumRamInfo["swap"] = paramsInfo[MEMORY_SIXTH];
sumRamInfo["swapPss"] = paramsInfo[MEMORY_SEVENTH];
sumRamInfo["heapSize"] = paramsInfo[MEMORY_EIGHTH];
sumRamInfo["heapAlloc"] = paramsInfo[MEMORY_NINTH];
sumRamInfo["heapFree"] = paramsInfo[MEMORY_TENTH].erase(paramsInfo[MEMORY_TENTH].size() - 1);
}
//if (paramsInfo.size() > 0) {
sumRamInfo["sharedClean"] = paramsInfo[MEMORY_SECOND];
sumRamInfo["sharedDirty"] = paramsInfo[MEMORY_THIRD];
sumRamInfo["privateClean"] = paramsInfo[MEMORY_FOURTH];
sumRamInfo["privateDirty"] = paramsInfo[MEMORY_FIFTH];
sumRamInfo["swap"] = paramsInfo[MEMORY_SIXTH];
sumRamInfo["swapPss"] = paramsInfo[MEMORY_SEVENTH];
sumRamInfo["heapSize"] = paramsInfo[MEMORY_EIGHTH];
sumRamInfo["heapAlloc"] = paramsInfo[MEMORY_NINTH];
sumRamInfo["heapFree"] = paramsInfo[MEMORY_TENTH].erase(paramsInfo[MEMORY_TENTH].size() - 1);
//}
return sumRamInfo;
}

View File

@ -44,7 +44,7 @@ public:
return instance;
}
std::map<std::string, std::string> ItemData() override;
void SetPackageName(std::string pName);
void SetPackageName(const std::string pName);
private:
MEMORY() {};

View File

@ -58,6 +58,7 @@ SpProfiler *SpProfilerFactory::GetProfilerItem(MessageType messageType)
} else if (messageType == MessageType::CATCH_TRACE_CONFIG) {
ProfilerFPS::GetInstance().SetTraceCatch();
} else if (messageType == MessageType::GET_CAPTURE) {
Capture::GetInstance().SocketMessage();
profiler = &Capture::GetInstance();
} else if (messageType == MessageType::SET_DUBAI_DB) {
Dubai::DumpDubaiBegin();
@ -101,7 +102,6 @@ void SpProfilerFactory::SetByTrace(std::string message)
int mInterval = 0;
long long mThreshold = 0;
int lowFps = 0;
int mCurNum = 1;
for (std::string vItem : values) {
std::vector<std::string> vItems;
SPUtils::StrSplit(vItem, delim, vItems);
@ -120,6 +120,7 @@ void SpProfilerFactory::SetByTrace(std::string message)
}
ByTrace &bTrace = ByTrace::GetInstance();
if (message.find("traceSum") != std::string::npos) {
int mCurNum = 1;
bTrace.SetTraceConfig(mSum, mInterval, mThreshold, lowFps, mCurNum);
}
if (message.find("bytrace -b 2048") != std::string::npos) {

View File

@ -29,7 +29,7 @@ using namespace std;
namespace OHOS {
namespace SmartPerf {
class SPdaemonTest : public testing::Test {
class SPdaemonFpsTest : public testing::Test {
public:
static void SetUpTestCase() {}
static void TearDownTestCase() {}
@ -42,7 +42,7 @@ public:
* @tc.desc: Test SetFpsCurrentFpsTime
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, SetFpsCurrentFpsTimeTestCase001, TestSize.Level1)
HWTEST_F(SPdaemonFpsTest, SetFpsCurrentFpsTimeTestCase001, TestSize.Level1)
{
bool ret = false;
FpsInfo fpsInfoResult;
@ -61,7 +61,7 @@ HWTEST_F(SPdaemonTest, SetFpsCurrentFpsTimeTestCase001, TestSize.Level1)
* @tc.desc: Test GetFpsCurrentFpsTime
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, GetFpsCurrentFpsTimeTestCase001, TestSize.Level1)
HWTEST_F(SPdaemonFpsTest, GetFpsCurrentFpsTimeTestCase001, TestSize.Level1)
{
bool ret = false;
FpsCurrentFpsTime fcf = FPS::GetInstance().GetFpsCurrentFpsTime();

View File

@ -30,7 +30,7 @@ using namespace std;
namespace OHOS {
namespace SmartPerf {
class SPdaemonTest : public testing::Test {
class SPdaemonGpuTest : public testing::Test {
public:
static void SetUpTestCase() {}
static void TearDownTestCase() {}
@ -43,7 +43,7 @@ public:
* @tc.desc: Test Init
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, Init001, TestSize.Level1)
HWTEST_F(SPdaemonGpuTest, Init001, TestSize.Level1)
{
std::string recvBuf;
std::map<std::string, std::string> data;
@ -54,7 +54,7 @@ HWTEST_F(SPdaemonTest, Init001, TestSize.Level1)
/*
// 002屏蔽GpuCounter.cpp 第35、78-83行进行测试后续测试添加依赖文件文件齐全所以屏蔽该测试
HWTEST_F(SPdaemonTest, Init002, TestSize.Level1)
HWTEST_F(SPdaemonGpuTest, Init002, TestSize.Level1)
{
std::string recvBuf;
std::map<std::string, std::string> data;
@ -99,7 +99,7 @@ HWTEST_F(SPdaemonTest, Init005, TestSize.Level1)
* @tc.desc: Test ItemData
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, ItemData001, TestSize.Level1)
HWTEST_F(SPdaemonGpuTest, ItemData001, TestSize.Level1)
{
bool ret = false;
std::string recvBuf = "catch_gpu_counter";
@ -121,7 +121,7 @@ HWTEST_F(SPdaemonTest, ItemData001, TestSize.Level1)
* @tc.desc: Test GetCounterDuration
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, GetCounterDuration001, TestSize.Level1)
HWTEST_F(SPdaemonGpuTest, GetCounterDuration001, TestSize.Level1)
{
int ret = -1;
const char* cmd = "cd /data/local/tmp";
@ -146,7 +146,7 @@ HWTEST_F(SPdaemonTest, GetCounterDuration001, TestSize.Level1)
* @tc.desc: Test Start
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, Start001, TestSize.Level1)
HWTEST_F(SPdaemonGpuTest, Start001, TestSize.Level1)
{
int ret = GpuCounter::GetInstance().Start();
EXPECT_EQ(ret, -1);
@ -157,7 +157,7 @@ HWTEST_F(SPdaemonTest, Start001, TestSize.Level1)
* @tc.desc: Test Rest
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, Rest001, TestSize.Level1)
HWTEST_F(SPdaemonGpuTest, Rest001, TestSize.Level1)
{
GpuCounter::GetInstance().Rest();
}
@ -167,7 +167,7 @@ HWTEST_F(SPdaemonTest, Rest001, TestSize.Level1)
* @tc.desc: Test Check
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, Check001, TestSize.Level1)
HWTEST_F(SPdaemonGpuTest, Check001, TestSize.Level1)
{
std::string recvBuf = "catch_gpu_counter";
std::map<std::string, std::string> data;

View File

@ -30,7 +30,7 @@ using namespace std;
namespace OHOS {
namespace SmartPerf {
class SPdaemonTest : public testing::Test {
class SPdaemonMainTest : public testing::Test {
public:
static void SetUpTestCase() {}
static void TearDownTestCase() {}
@ -113,7 +113,7 @@ bool CheckCMDParam(std::vector<std::string> &argv, std::string &errorInfo)
* @tc.desc: Test GetOptions
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, GetOptionsTestCase001, TestSize.Level1)
HWTEST_F(SPdaemonMainTest, GetOptionsTestCase001, TestSize.Level1)
{
bool ret = false;
@ -138,7 +138,7 @@ HWTEST_F(SPdaemonTest, GetOptionsTestCase001, TestSize.Level1)
* @tc.desc: Test CheckCMDParam
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, CheckCMDParamTestCase001, TestSize.Level1)
HWTEST_F(SPdaemonMainTest, CheckCMDParamTestCase001, TestSize.Level1)
{
std::string errorInfo = "";
std::vector<std::string> argv;
@ -156,7 +156,7 @@ HWTEST_F(SPdaemonTest, CheckCMDParamTestCase001, TestSize.Level1)
EXPECT_EQ(ret, true);
}
HWTEST_F(SPdaemonTest, CheckCMDParamTestCase002, TestSize.Level1)
HWTEST_F(SPdaemonMainTest, CheckCMDParamTestCase002, TestSize.Level1)
{
std::string errorInfo = "";
std::vector<std::string> argv;
@ -171,7 +171,7 @@ HWTEST_F(SPdaemonTest, CheckCMDParamTestCase002, TestSize.Level1)
EXPECT_EQ(ret, false);
}
HWTEST_F(SPdaemonTest, CheckCMDParamTestCase003, TestSize.Level1)
HWTEST_F(SPdaemonMainTest, CheckCMDParamTestCase003, TestSize.Level1)
{
std::string errorInfo = "";
std::vector<std::string> argv;

View File

@ -31,7 +31,7 @@ using namespace std;
namespace OHOS {
namespace SmartPerf {
class SPdaemonTest : public testing::Test {
class SPdaemonTaskTest : public testing::Test {
public:
static void SetUpTestCase() {}
static void TearDownTestCase() {}
@ -44,7 +44,7 @@ public:
* @tc.desc: Test CheckTcpParam
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, CheckTcpParamTestCase001, TestSize.Level1)
HWTEST_F(SPdaemonTaskTest, CheckTcpParamTestCase001, TestSize.Level1)
{
std::string str = "-SESSIONID 12345678 -INTERVAL 1000 -PKG ohos.samples.ecg -c -g -t -p -f -r";
std::string errorInfo = "";
@ -53,7 +53,7 @@ HWTEST_F(SPdaemonTest, CheckTcpParamTestCase001, TestSize.Level1)
EXPECT_TRUE(flag);
}
HWTEST_F(SPdaemonTest, CheckTcpParamTestCase002, TestSize.Level1)
HWTEST_F(SPdaemonTaskTest, CheckTcpParamTestCase002, TestSize.Level1)
{
std::string str = "";
std::string errorInfo = "";
@ -62,7 +62,7 @@ HWTEST_F(SPdaemonTest, CheckTcpParamTestCase002, TestSize.Level1)
EXPECT_FALSE(flag);
}
HWTEST_F(SPdaemonTest, CheckTcpParamTestCase003, TestSize.Level1)
HWTEST_F(SPdaemonTaskTest, CheckTcpParamTestCase003, TestSize.Level1)
{
std::string str = "";
std::string errorInfo = "";
@ -76,7 +76,7 @@ HWTEST_F(SPdaemonTest, CheckTcpParamTestCase003, TestSize.Level1)
* @tc.desc: Test DetectionAndGrab
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, DetectionAndGrabTestCase001, TestSize.Level1)
HWTEST_F(SPdaemonTaskTest, DetectionAndGrabTestCase001, TestSize.Level1)
{
bool ret = false;
std::map<std::string, std::string> templateMap;

View File

@ -28,7 +28,7 @@ using namespace std;
namespace OHOS {
namespace SmartPerf {
class SPdaemonTest : public testing::Test {
class SPdaemonUtilsTest : public testing::Test {
public:
static void SetUpTestCase() {}
static void TearDownTestCase() {}
@ -41,7 +41,7 @@ public:
* @tc.desc: Test IntegerValueVerification
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, IntegerValueVerificationTest001, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, IntegerValueVerificationTest001, TestSize.Level1)
{
std::string errorInfo;
std::map<std::string, std::string> mapInfo;
@ -59,7 +59,7 @@ HWTEST_F(SPdaemonTest, IntegerValueVerificationTest001, TestSize.Level1)
EXPECT_EQ(ret, false);
}
HWTEST_F(SPdaemonTest, IntegerValueVerificationTest002, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, IntegerValueVerificationTest002, TestSize.Level1)
{
std::string errorInfo;
std::map<std::string, std::string> mapInfo;
@ -77,7 +77,7 @@ HWTEST_F(SPdaemonTest, IntegerValueVerificationTest002, TestSize.Level1)
EXPECT_EQ(ret, false);
}
HWTEST_F(SPdaemonTest, IntegerValueVerificationTest003, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, IntegerValueVerificationTest003, TestSize.Level1)
{
std::string errorInfo;
std::map<std::string, std::string> mapInfo;
@ -100,7 +100,7 @@ HWTEST_F(SPdaemonTest, IntegerValueVerificationTest003, TestSize.Level1)
* @tc.desc: Test VerifyValueStr
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, VerifyValueStrTest001, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, VerifyValueStrTest001, TestSize.Level1)
{
std::string errorInfo;
std::map<std::string, std::string> mapInfo;
@ -109,7 +109,7 @@ HWTEST_F(SPdaemonTest, VerifyValueStrTest001, TestSize.Level1)
EXPECT_EQ(ret, false);
}
HWTEST_F(SPdaemonTest, VerifyValueStrTest002, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, VerifyValueStrTest002, TestSize.Level1)
{
std::string errorInfo;
std::map<std::string, std::string> mapInfo;
@ -119,7 +119,7 @@ HWTEST_F(SPdaemonTest, VerifyValueStrTest002, TestSize.Level1)
EXPECT_EQ(ret, false);
}
HWTEST_F(SPdaemonTest, VerifyValueStrTest003, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, VerifyValueStrTest003, TestSize.Level1)
{
std::string errorInfo;
std::map<std::string, std::string> mapInfo;
@ -130,7 +130,7 @@ HWTEST_F(SPdaemonTest, VerifyValueStrTest003, TestSize.Level1)
EXPECT_EQ(ret, false);
}
HWTEST_F(SPdaemonTest, VerifyValueStrTest004, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, VerifyValueStrTest004, TestSize.Level1)
{
std::string errorInfo;
std::map<std::string, std::string> mapInfo;
@ -141,7 +141,7 @@ HWTEST_F(SPdaemonTest, VerifyValueStrTest004, TestSize.Level1)
EXPECT_EQ(ret, false);
}
HWTEST_F(SPdaemonTest, VerifyValueStrTest005, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, VerifyValueStrTest005, TestSize.Level1)
{
std::string errorInfo;
std::map<std::string, std::string> mapInfo;
@ -152,7 +152,7 @@ HWTEST_F(SPdaemonTest, VerifyValueStrTest005, TestSize.Level1)
EXPECT_EQ(ret, false);
}
HWTEST_F(SPdaemonTest, VerifyValueStrTest006, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, VerifyValueStrTest006, TestSize.Level1)
{
std::string errorInfo;
std::map<std::string, std::string> mapInfo;
@ -167,7 +167,7 @@ HWTEST_F(SPdaemonTest, VerifyValueStrTest006, TestSize.Level1)
* @tc.desc: Test VeriyKey
* @tc.type: FUNC
*/
HWTEST_F(SPdaemonTest, VeriyKey001, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, VeriyKey001, TestSize.Level1)
{
std::set<std::string> keys;
std::map<std::string, std::string> mapInfo;
@ -187,7 +187,7 @@ HWTEST_F(SPdaemonTest, VeriyKey001, TestSize.Level1)
EXPECT_EQ(ret, false);
}
HWTEST_F(SPdaemonTest, VeriyKey002, TestSize.Level1)
HWTEST_F(SPdaemonUtilsTest, VeriyKey002, TestSize.Level1)
{
std::set<std::string> keys;
std::map<std::string, std::string> mapInfo;