清理告警

Signed-off-by: 钱玉英 <qianyuying@huawei.com>
This commit is contained in:
钱玉英 2024-05-06 14:56:26 +08:00
parent e78edb0eed
commit 64bbb561f9
17 changed files with 605 additions and 752 deletions

View File

@ -82,7 +82,7 @@ std::map<std::string, std::string> RAM::GetRamInfo() const
procRamInfo["pss"] = "NA"; procRamInfo["pss"] = "NA";
return procRamInfo; return procRamInfo;
} }
std::string cmd = "hidumper --mem "+ processId; std::string cmd = "hidumper --mem " + processId;
FILE *fd = popen(cmd.c_str(), "r"); FILE *fd = popen(cmd.c_str(), "r");
if (fd == nullptr) { if (fd == nullptr) {
return procRamInfo; return procRamInfo;

View File

@ -192,7 +192,11 @@ void ProfilerFPS::GetSectionsFps(FpsInfoProfiler &fpsInfoResult) const
currLastTime += harTime; currLastTime += harTime;
count--; count--;
} }
if (i == (static_cast<int>(fpsInfoResult.currTimeStamps.size()) - 1)) { long long size = fpsInfoResult.currTimeStamps.size();
if (size < 1) {
return;
}
if (i == (size - 1)) {
printf("sectionsFps:%d|%lld\n", msCount * ten, currLastTime); printf("sectionsFps:%d|%lld\n", msCount * ten, currLastTime);
printCount++; printCount++;
GetSectionsPrint(printCount, currLastTime); GetSectionsPrint(printCount, currLastTime);
@ -224,8 +228,7 @@ FpsInfoProfiler ProfilerFPS::GetFpsInfo()
{ {
fpsInfoMax.fps = 0; fpsInfoMax.fps = 0;
std::string uniteLayer = "UniRender"; std::string uniteLayer = "UniRender";
if (pkgName.empty() || pkgName.find("desktops") != std::string::npos) { if (pkgName.empty()) {
LOGI("ProfilerFPS.pkgName===: %s", pkgName.c_str());
GetCurrentTime(fifty); GetCurrentTime(fifty);
fpsInfoMax = GetSurfaceFrame(uniteLayer); fpsInfoMax = GetSurfaceFrame(uniteLayer);
} else { } else {

View File

@ -247,14 +247,11 @@ void StartUpDelay::InitXY2(const std::string &curAppName, const std::string &fil
size_t appIndex = strLine.find(curAppName); size_t appIndex = strLine.find(curAppName);
if (appIndex != std::string::npos) { if (appIndex != std::string::npos) {
findIndex = appIndex; findIndex = appIndex;
if (findIndex == std::string::npos) {
break;
}
} else { } else {
findIndex = appPkgIndex; findIndex = appPkgIndex;
if (findIndex == std::string::npos) { }
break; if (findIndex == std::string::npos) {
} break;
} }
size_t bounds = strLine.rfind("bounds", findIndex); size_t bounds = strLine.rfind("bounds", findIndex);
if (bounds > 0) { if (bounds > 0) {
@ -276,8 +273,12 @@ void StartUpDelay::InitXY2(const std::string &curAppName, const std::string &fil
} else { } else {
size_t leftStart = boundStr.find_first_of("["); size_t leftStart = boundStr.find_first_of("[");
size_t leftEnd = boundStr.find_first_of("]"); size_t leftEnd = boundStr.find_first_of("]");
pointXY = boundStr.substr(leftStart + 1, static_cast<int>(leftEnd - leftStart - 1)); if (leftStart != std::string::npos && leftEnd != std::string::npos && leftEnd > leftStart) {
pointXY = pointXY.replace(pointXY.find(","), 1, " "); std::string pointSubstr = boundStr.substr(leftStart + 1, leftEnd - leftStart - 1);
pointXY = std::regex_replace(pointSubstr, std::regex(","), " ");
} else {
std::cout << "Error extracting bounds." << std::endl;
}
} }
break; break;
} }
@ -319,9 +320,12 @@ void StartUpDelay::InitXY(const std::string &curAppName, const std::string &file
} else { } else {
size_t leftStart = boundStr.find_first_of("["); size_t leftStart = boundStr.find_first_of("[");
size_t leftEnd = boundStr.find_first_of("]"); size_t leftEnd = boundStr.find_first_of("]");
int pointXYLength = static_cast<int>(leftEnd - leftStart - 1); if (leftStart != std::string::npos && leftEnd != std::string::npos && leftEnd > leftStart) {
pointXY = boundStr.substr(leftStart + 1, pointXYLength); std::string pointSubstr = boundStr.substr(leftStart + 1, leftEnd - leftStart - 1);
pointXY = pointXY.replace(pointXY.find(","), 1, " "); pointXY = std::regex_replace(pointSubstr, std::regex(","), " ");
} else {
std::cout << "Error extracting bounds." << std::endl;
}
} }
break; break;
} }

View File

@ -59,7 +59,7 @@ HWTEST_F(SPdaemonGpuTest, Init001, TestSize.Level1)
int ret = GpuCounter::GetInstance().Init(recvBuf, data); int ret = GpuCounter::GetInstance().Init(recvBuf, data);
SPUtils::LoadCmd(constCheckProductInfo, result); SPUtils::LoadCmd(constCheckProductInfo, result);
if (result.empty() || std::string::npos == result.find(constProductInfo)) { if (result.empty() || result.find(constProductInfo) == std::string::npos) {
EXPECT_EQ(ret, -4); EXPECT_EQ(ret, -4);
return; return;
} }

View File

@ -163,7 +163,7 @@ static void ProcessFpsResult(FpsConfig &fpsConfig, FpsInfo &fpsInfo, long long f
(fpsInfo.timeStampQ).push(frameReadyTime); (fpsInfo.timeStampQ).push(frameReadyTime);
} }
} }
static void ProcessResult(FILE *fp, FpsConfig &fpsConfig, FpsInfo &fpsInfo) static void ProcessResult(FILE *fp, FpsConfig &fpsConfig, FpsInfo &fpsInfo)
{ {
char tmp[1024]; char tmp[1024];
while (fgets(tmp, sizeof(tmp), fp) != nullptr) { while (fgets(tmp, sizeof(tmp), fp) != nullptr) {
@ -297,6 +297,10 @@ static std::string GetSurFace()
} }
static void GetFpsUniteInfo(int num) static void GetFpsUniteInfo(int num)
{ {
if (num <= 0) {
printf("Invalid value for num: %d\n", num);
return;
}
FpsInfo gfpsInfo; FpsInfo gfpsInfo;
FpsInfo gfpsUniteInfo; FpsInfo gfpsUniteInfo;
std::string layerName; std::string layerName;

View File

@ -24,7 +24,7 @@ export struct FloatWindowComponent {
private settings: RenderingContextSettings = new RenderingContextSettings(true) private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
@State title: string = 'SmartPerf' @State title: string = 'SmartPerf'
private xPoint: number = 5 //x起始坐标 private xPoint: number = 5
private yPoint: number = 108 //Y起始坐标 private yPoint: number = 108 //Y起始坐标
private xScale: number = 8 //刻度 private xScale: number = 8 //刻度
private yScale: number = 21 //刻度 private yScale: number = 21 //刻度

View File

@ -159,6 +159,7 @@ export default {
name: dbName, name: dbName,
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TGeneralInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -183,7 +184,6 @@ export default {
]); ]);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TGeneralInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sessionId = resultSet.getString( let sessionId = resultSet.getString(
resultSet.getColumnIndex('sessionId') resultSet.getColumnIndex('sessionId')
@ -244,6 +244,7 @@ export default {
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR(TAG, 'resultSet queryGeneralData:err' + err); SPLogger.ERROR(TAG, 'resultSet queryGeneralData:err' + err);
return results;
} }
}, },
@ -253,6 +254,7 @@ export default {
name: dbPath, name: dbPath,
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TIndexInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -299,7 +301,6 @@ export default {
]); ]);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TIndexInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let timestamp = resultSet.getString( let timestamp = resultSet.getString(
resultSet.getColumnIndex('timestamp') resultSet.getColumnIndex('timestamp')
@ -461,6 +462,7 @@ export default {
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR(TAG, 'resultSet queryIndexInfo Data:err' + err); SPLogger.ERROR(TAG, 'resultSet queryIndexInfo Data:err' + err);
return results;
} }
}, },
/** /**
@ -642,7 +644,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -664,7 +666,6 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = 'display'; let sensor = 'display';
let power = resultSet.getString(resultSet.getColumnIndex('power')); let power = resultSet.getString(resultSet.getColumnIndex('power'));
@ -692,6 +693,7 @@ export default {
TAG, TAG,
'resultSet query_applications_display err22222:' + err 'resultSet query_applications_display err22222:' + err
); );
return results;
} }
}, },
//查询表task_powersensor_info //查询表task_powersensor_info
@ -702,18 +704,16 @@ export default {
name: pathSuffix + '.db', name: pathSuffix + '.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
.then(async (rdbStore) => { .then(async (rdbStore) => {
let strSQL: string = let strSQL: string =
'select * ' + 'from task_powersensor_info order by power desc '; 'select * ' + 'from task_powersensor_info order by power desc ';
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = resultSet.getString( let sensor = resultSet.getString(
resultSet.getColumnIndex('sensor') resultSet.getColumnIndex('sensor')
@ -738,6 +738,7 @@ export default {
TAG, TAG,
'resultSet query_applications_display err22222:' + err 'resultSet query_applications_display err22222:' + err
); );
return results;
} }
}, },
//查询表detailed_applications_cpu //查询表detailed_applications_cpu
@ -750,7 +751,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -768,34 +769,19 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = 'cpu'; let sensor = 'cpu';
let power = resultSet.getString(resultSet.getColumnIndex('power')); let power = resultSet.getString(resultSet.getColumnIndex('power'));
let current = resultSet.getString( let current = resultSet.getString(
resultSet.getColumnIndex('current') resultSet.getColumnIndex('current')
); );
let tPowerSensorInfo = new TPowerSensorInfo( let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
'',
sensor,
power,
current,
''
);
results.push(tPowerSensorInfo); results.push(tPowerSensorInfo);
} }
SPLogger.INFO(
'TAG',
'resultSet query_applications_display-----cpu' +
JSON.stringify(results)
);
return results; return results;
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR( return results;
TAG,
'resultSet query_applications_display err22222:' + err
);
} }
}, },
//查询表detailed_applications_gpu //查询表detailed_applications_gpu
@ -808,7 +794,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -826,34 +812,19 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = 'gpu'; let sensor = 'gpu';
let power = resultSet.getString(resultSet.getColumnIndex('power')); let power = resultSet.getString(resultSet.getColumnIndex('power'));
let current = resultSet.getString( let current = resultSet.getString(
resultSet.getColumnIndex('current') resultSet.getColumnIndex('current')
); );
let tPowerSensorInfo = new TPowerSensorInfo( let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
'',
sensor,
power,
current,
''
);
results.push(tPowerSensorInfo); results.push(tPowerSensorInfo);
} }
SPLogger.INFO(
'TAG',
'resultSet query_applications_display-----gpu' +
JSON.stringify(results)
);
return results; return results;
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR( return results;
TAG,
'resultSet query_applications_display err22222:' + err
);
} }
}, },
//查询表detailed_applications_wifi_data //查询表detailed_applications_wifi_data
@ -866,7 +837,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -883,34 +854,19 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = 'wifi_data'; let sensor = 'wifi_data';
let power = resultSet.getString(resultSet.getColumnIndex('power')); let power = resultSet.getString(resultSet.getColumnIndex('power'));
let current = resultSet.getString( let current = resultSet.getString(
resultSet.getColumnIndex('current') resultSet.getColumnIndex('current')
); );
let tPowerSensorInfo = new TPowerSensorInfo( let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
'',
sensor,
power,
current,
''
);
results.push(tPowerSensorInfo); results.push(tPowerSensorInfo);
} }
SPLogger.INFO(
'TAG',
'resultSet query_applications_display-----wifi_data' +
JSON.stringify(results)
);
return results; return results;
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR( return results;
TAG,
'resultSet query_applications_display err22222:' + err
);
} }
}, },
//查询表detailed_applications_system_idle //查询表detailed_applications_system_idle
@ -923,7 +879,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -940,34 +896,19 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = 'system_idle'; let sensor = 'system_idle';
let power = resultSet.getString(resultSet.getColumnIndex('power')); let power = resultSet.getString(resultSet.getColumnIndex('power'));
let current = resultSet.getString( let current = resultSet.getString(
resultSet.getColumnIndex('current') resultSet.getColumnIndex('current')
); );
let tPowerSensorInfo = new TPowerSensorInfo( let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
'',
sensor,
power,
current,
''
);
results.push(tPowerSensorInfo); results.push(tPowerSensorInfo);
} }
SPLogger.INFO(
'TAG',
'resultSet query_applications_display-----system_idle' +
JSON.stringify(results)
);
return results; return results;
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR( return results;
TAG,
'resultSet query_applications_display err22222:' + err
);
} }
}, },
//查询表detailed_applications_audio //查询表detailed_applications_audio
@ -980,7 +921,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -997,34 +938,19 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = 'audio'; let sensor = 'audio';
let power = resultSet.getString(resultSet.getColumnIndex('power')); let power = resultSet.getString(resultSet.getColumnIndex('power'));
let current = resultSet.getString( let current = resultSet.getString(
resultSet.getColumnIndex('current') resultSet.getColumnIndex('current')
); );
let tPowerSensorInfo = new TPowerSensorInfo( let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
'',
sensor,
power,
current,
''
);
results.push(tPowerSensorInfo); results.push(tPowerSensorInfo);
} }
SPLogger.INFO(
'TAG',
'resultSet query_applications_display-----audio' +
JSON.stringify(results)
);
return results; return results;
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR( return results;
TAG,
'resultSet query_applications_display err22222:' + err
);
} }
}, },
//查询表detailed_applications_dss //查询表detailed_applications_dss
@ -1037,7 +963,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -1054,34 +980,19 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = 'dss'; let sensor = 'dss';
let power = resultSet.getString(resultSet.getColumnIndex('power')); let power = resultSet.getString(resultSet.getColumnIndex('power'));
let current = resultSet.getString( let current = resultSet.getString(
resultSet.getColumnIndex('current') resultSet.getColumnIndex('current')
); );
let tPowerSensorInfo = new TPowerSensorInfo( let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
'',
sensor,
power,
current,
''
);
results.push(tPowerSensorInfo); results.push(tPowerSensorInfo);
} }
SPLogger.INFO(
'TAG',
'resultSet query_applications_display-----dss' +
JSON.stringify(results)
);
return results; return results;
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR( return results;
TAG,
'resultSet query_applications_display err22222:' + err
);
} }
}, },
//查询表detailed_applications_ddr //查询表detailed_applications_ddr
@ -1094,7 +1005,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -1111,36 +1022,22 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = 'ddr'; let sensor = 'ddr';
let power = resultSet.getString(resultSet.getColumnIndex('power')); let power = resultSet.getString(resultSet.getColumnIndex('power'));
let current = resultSet.getString( let current = resultSet.getString(
resultSet.getColumnIndex('current') resultSet.getColumnIndex('current')
); );
let tPowerSensorInfo = new TPowerSensorInfo( let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
'',
sensor,
power,
current,
''
);
results.push(tPowerSensorInfo); results.push(tPowerSensorInfo);
} }
SPLogger.INFO(
'TAG',
'resultSet query_applications_display-----ddr' +
JSON.stringify(results)
);
return results; return results;
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR( return results;
TAG,
'resultSet query_applications_display err22222:' + err
);
} }
}, //查询表detailed_applications_sensor },
//查询表detailed_applications_sensor
async query_applications_sensor( async query_applications_sensor(
start_time: String, start_time: String,
end_time: String, end_time: String,
@ -1150,7 +1047,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -1167,34 +1064,19 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = 'sensor'; let sensor = 'sensor';
let power = resultSet.getString(resultSet.getColumnIndex('power')); let power = resultSet.getString(resultSet.getColumnIndex('power'));
let current = resultSet.getString( let current = resultSet.getString(
resultSet.getColumnIndex('current') resultSet.getColumnIndex('current')
); );
let tPowerSensorInfo = new TPowerSensorInfo( let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
'',
sensor,
power,
current,
''
);
results.push(tPowerSensorInfo); results.push(tPowerSensorInfo);
} }
SPLogger.INFO(
'TAG',
'resultSet query_applications_display-----sensor' +
JSON.stringify(results)
);
return results; return results;
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR( return results;
TAG,
'resultSet query_applications_display err22222:' + err
);
} }
}, },
//查询表detailed_applications_rom //查询表detailed_applications_rom
@ -1207,7 +1089,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerSensorInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -1224,34 +1106,19 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerSensorInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let sensor = 'rom'; let sensor = 'rom';
let power = resultSet.getString(resultSet.getColumnIndex('power')); let power = resultSet.getString(resultSet.getColumnIndex('power'));
let current = resultSet.getString( let current = resultSet.getString(
resultSet.getColumnIndex('current') resultSet.getColumnIndex('current')
); );
let tPowerSensorInfo = new TPowerSensorInfo( let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
'',
sensor,
power,
current,
''
);
results.push(tPowerSensorInfo); results.push(tPowerSensorInfo);
} }
SPLogger.INFO(
'TAG',
'resultSet query_applications_display-----rom' +
JSON.stringify(results)
);
return results; return results;
}); });
} catch (err) { } catch (err) {
SPLogger.ERROR( return results;
TAG,
'resultSet query_applications_display err22222:' + err
);
} }
}, },
//查询dubai 所有进程功耗 并插入表 t_power_appinfo //查询dubai 所有进程功耗 并插入表 t_power_appinfo
@ -1263,7 +1130,7 @@ export default {
name: 'dubai.db', name: 'dubai.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerAppInfo[] = [];
let strSQL: String = ''; let strSQL: String = '';
try { try {
return await relationalStore return await relationalStore
@ -1334,7 +1201,6 @@ export default {
tMap.set(name, sum_energy); tMap.set(name, sum_energy);
} }
} }
let results: TPowerAppInfo[] = [];
//遍历去重相加后的arr //遍历去重相加后的arr
for (let [name, power] of tMap) { for (let [name, power] of tMap) {
let percent = (Number(power) * 100) / totalSumEnergy; let percent = (Number(power) * 100) / totalSumEnergy;
@ -1373,6 +1239,7 @@ export default {
TAG, TAG,
'resultSet query_applications_display err22222:' + err 'resultSet query_applications_display err22222:' + err
); );
return results;
} }
}, },
@ -1382,6 +1249,7 @@ export default {
name: pathSuffix + '.db', name: pathSuffix + '.db',
securityLevel: relationalStore.SecurityLevel.S1, securityLevel: relationalStore.SecurityLevel.S1,
}; };
let results: TPowerAppInfo[] = [];
try { try {
return await relationalStore return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG) .getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -1392,7 +1260,6 @@ export default {
return rdbStore.querySql(strSQL); return rdbStore.querySql(strSQL);
}) })
.then((resultSet) => { .then((resultSet) => {
let results: TPowerAppInfo[] = [];
while (resultSet.goToNextRow()) { while (resultSet.goToNextRow()) {
let process = resultSet.getString( let process = resultSet.getString(
resultSet.getColumnIndex('process') resultSet.getColumnIndex('process')
@ -1421,6 +1288,7 @@ export default {
TAG, TAG,
'resultSet query_applications_display query_powerapp_info:' + err 'resultSet query_applications_display query_powerapp_info:' + err
); );
return results;
} }
}, },
}; };

View File

@ -36,8 +36,8 @@ export struct Performance {
@State private gpData: TIndexInfo[] = [] @State private gpData: TIndexInfo[] = []
@State lostList: FpsLostFrame[] = [] @State lostList: FpsLostFrame[] = []
public lostLine: Array<number> = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] public lostLine: Array<number> = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
public fpsValues: Array<number> = [] public fpsValues: number[] = []
public fpsJitterValues: Array<string> = [] public fpsJitterValues: string[] = []
public topAxis: XAxis = new XAxis(); //顶部X轴 public topAxis: XAxis = new XAxis(); //顶部X轴
public bottomAxis: XAxis = new XAxis(); //底部X轴 public bottomAxis: XAxis = new XAxis(); //底部X轴
public atWidth: number = 350; //表的宽度 public atWidth: number = 350; //表的宽度

View File

@ -125,7 +125,7 @@ export struct Summary {
cpuB = cpuFreqMap.get('cpu' + cpuCoreArr[1] + 'FreqSum') / 1e3 cpuB = cpuFreqMap.get('cpu' + cpuCoreArr[1] + 'FreqSum') / 1e3
cpuC = cpuFreqMap.get('cpu' + cpuCoreArr[2] + 'FreqSum') / 1e3 cpuC = cpuFreqMap.get('cpu' + cpuCoreArr[2] + 'FreqSum') / 1e3
} }
var cpuList = [cpuA, cpuB, cpuC].sort() let cpuList = [cpuA, cpuB, cpuC].sort()
cpuMin = cpuList[0] cpuMin = cpuList[0]
cpuMid = cpuList[1] cpuMid = cpuList[1]

View File

@ -123,7 +123,7 @@ export struct Current {
} }
let gradientFillColor: Array<ColorStop> = []; let gradientFillColor: ColorStop[] = [];
gradientFillColor.push([0x0C0099CC, 0.2]) gradientFillColor.push([0x0C0099CC, 0.2])
gradientFillColor.push([0x7F0099CC, 0.4]) gradientFillColor.push([0x7F0099CC, 0.4])
gradientFillColor.push([0x0099CC, 1.0]) gradientFillColor.push([0x0099CC, 1.0])

View File

@ -555,8 +555,7 @@ export default abstract class Chart<T> {
if (callListener && this.mSelectionListener != null) { if (callListener && this.mSelectionListener != null) {
if (!this.valuesToHighlight()) { if (!this.valuesToHighlight()) {
this.mSelectionListener.onNothingSelected(); this.mSelectionListener.onNothingSelected();
} } else {
else {
// notify the listener // notify the listener
this.mSelectionListener.onValueSelected(e, high); this.mSelectionListener.onValueSelected(e, high);
} }

View File

@ -193,10 +193,10 @@ export class PathViewModel extends ScaleMode {
this.xScale = (this.rect.right - this.rect.left) / (this.xAxis.getAxisMaximum() - this.xAxis.getAxisMinimum()); this.xScale = (this.rect.right - this.rect.left) / (this.xAxis.getAxisMaximum() - this.xAxis.getAxisMinimum());
this.yLeftScale = (this.rect.bottom - this.rect.top) / this.yLeftScale = (this.rect.bottom - this.rect.top) /
(this.yleftAxis.getAxisMaximum() - this.yleftAxis.getAxisMinimum()); (this.yleftAxis.getAxisMaximum() - this.yleftAxis.getAxisMinimum());
this.yRightScale = (this.rect.bottom - this.rect.top) / this.yRightScale = (this.rect.bottom - this.rect.top) /
(this.yRightAxis.getAxisMaximum() - this.yRightAxis.getAxisMinimum()); (this.yRightAxis.getAxisMaximum() - this.yRightAxis.getAxisMinimum());
} }

View File

@ -343,9 +343,9 @@ export default class XAxisRenderer extends AxisRenderer {
public renderLimitLines(): Paint[] { public renderLimitLines(): Paint[] {
let limitLines: JArrayList<LimitLine> = this.mXAxis.getLimitLines(); let limitLines: JArrayList<LimitLine> = this.mXAxis.getLimitLines();
if (limitLines == null if (limitLines == null ||
|| limitLines.size() <= 0 limitLines.size() <= 0 ||
|| !this.mAxis.isDrawLimitLinesBehindDataEnabled()) { !this.mAxis.isDrawLimitLinesBehindDataEnabled()) {
return []; return [];
} }

View File

@ -93,7 +93,7 @@ export struct Report {
}) })
} }
} }
}, item => JSON.stringify(item)) }, item => item.toString())
} }
.edgeEffect(EdgeEffect.None) // 滑动到边缘无效果 .edgeEffect(EdgeEffect.None) // 滑动到边缘无效果
.chainAnimation(false) // 联动特效关闭 .chainAnimation(false) // 联动特效关闭

View File

@ -35,7 +35,7 @@ export default class CheckEmptyUtils {
* @param {string} str need checked string * @param {string} str need checked string
* @return {boolean} true(empty) * @return {boolean} true(empty)
*/ */
static checkStrIsEmpty(str): boolean { static checkStrIsEmpty(str): boolean {
return str.trim().length === 0; return str.trim().length === 0;
} }
@ -45,7 +45,7 @@ export default class CheckEmptyUtils {
* @param {Array} arr need checked array * @param {Array} arr need checked array
* @return {boolean} true(empty) * @return {boolean} true(empty)
*/ */
static isEmptyArr(arr): boolean { static isEmptyArr(arr): boolean {
return arr.length === 0; return arr.length === 0;
} }
} }

View File

@ -59,7 +59,7 @@ struct CPU2LineChartPage {
Stack({ alignContent: Alignment.Top }) { Stack({ alignContent: Alignment.Top }) {
FloatWindowComponent({ title: `sp_cpu2Frequency`, data: this.data }) FloatWindowComponent({ title: `sp_cpu2Frequency`, data: this.data })
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Text(this.floatName + ':' ) Text(this.floatName + ':')
.fontSize('10fp') .fontSize('10fp')
.fontColor($r('app.color.color_fff')) .fontColor($r('app.color.color_fff'))
.margin({ left: 5, top: 1 }) //文本显示 .margin({ left: 5, top: 1 }) //文本显示