This commit is contained in:
2023-07-06 21:48:42 +03:00
parent b763f0e5cd
commit b19d50ba62
3 changed files with 14 additions and 11 deletions

View File

@@ -21,6 +21,7 @@
#include "pidir.h"
#include "piincludes_p.h"
#include "piliterals.h"
#include "piprocess.h"
#include "pisysteminfo.h"
#include "pitime_win.h"
@@ -84,7 +85,7 @@ PISystemMonitor::PISystemMonitor(): PIThread() {
PRIVATE->mem_cnt.cb = sizeof(PRIVATE->mem_cnt);
# endif
#endif
setName("system_monitor");
setName("system_monitor"_a);
}
@@ -208,7 +209,7 @@ void PISystemMonitor::run() {
// piCout << (PRIVATE->cpu_u_cur - PRIVATE->cpu_u_prev).toMilliseconds() / delay_;
# else
PRIVATE->file.seekToBegin();
PIString str(PRIVATE->file.readAll(true));
PIString str = PIString::fromAscii(PRIVATE->file.readAll(true));
int si = str.find('(') + 1, fi = 0, cc = 1;
for (int i = si; i < str.size_s(); ++i) {
if (str[i] == '(') cc++;
@@ -246,7 +247,7 @@ void PISystemMonitor::run() {
// piCout << sl[0] << sl[12] << sl[13];
PRIVATE->filem.seekToBegin();
str = PRIVATE->filem.readAll(true);
str = PIString::fromAscii(PRIVATE->filem.readAll(true));
sl = str.split(" ");
if (sl.size_s() < 6) return;
tstat.virtual_memsize = sl[0].toLong() * page_size;
@@ -352,7 +353,7 @@ void PISystemMonitor::gatherThread(llong id) {
PIFile f(PRIVATE->proc_dir + "task/" + PIString::fromNumber(id) + "/stat");
// piCout << f.path();
if (!f.open(PIIODevice::ReadOnly)) return;
PIString str = f.readAll(true);
PIString str = PIString::fromAscii(f.readAll(true));
int si = str.find('(') + 1, fi = 0, cc = 1;
for (int i = si; i < str.size_s(); ++i) {
if (str[i] == '(') cc++;