chore: formatter
This commit is contained in:
@@ -45,8 +45,7 @@ void Memory::tick() {
|
||||
QStringLiteral("MemTotal: *(\\d+)"));
|
||||
static const QRegularExpression reAvail(
|
||||
QStringLiteral("MemAvailable: *(\\d+)"));
|
||||
static const QRegularExpression reCached(QStringLiteral(
|
||||
"Cached: *(\\d+)"));
|
||||
static const QRegularExpression reCached(QStringLiteral("Cached: *(\\d+)"));
|
||||
const QString text = QString::fromLatin1(data);
|
||||
|
||||
const auto totalMatch = reTotal.match(text);
|
||||
@@ -78,14 +77,14 @@ void Memory::tick() {
|
||||
const auto pgin = rePgin.match(vtext);
|
||||
const auto pgout = rePgout.match(vtext);
|
||||
if (pgin.hasMatch()) {
|
||||
readKib = static_cast<quint64>(static_cast<double>(
|
||||
pgin.captured(1).toULongLong()) *
|
||||
pageKib);
|
||||
readKib = static_cast<quint64>(
|
||||
static_cast<double>(pgin.captured(1).toULongLong()) *
|
||||
pageKib);
|
||||
}
|
||||
if (pgout.hasMatch()) {
|
||||
writeKib = static_cast<quint64>(static_cast<double>(
|
||||
pgout.captured(1).toULongLong()) *
|
||||
pageKib);
|
||||
writeKib = static_cast<quint64>(
|
||||
static_cast<double>(pgout.captured(1).toULongLong()) *
|
||||
pageKib);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -793,8 +793,7 @@ void ProcessModel::scanChunk(
|
||||
nowTicks > prevTicks ? nowTicks - prevTicks : 0;
|
||||
entry.cpuPercent =
|
||||
(static_cast<double>(deltaTicks) /
|
||||
(ctx.deltaSecs *
|
||||
static_cast<double>(ctx.clockTicksPerSec))) *
|
||||
(ctx.deltaSecs * static_cast<double>(ctx.clockTicksPerSec))) *
|
||||
100.0;
|
||||
} else {
|
||||
entry.cpuPercent = 0.0;
|
||||
@@ -839,7 +838,8 @@ ProcessModel::ScanResult ProcessModel::scanProcesses(
|
||||
// syscall-bound (open/read/close per file per process) and serializes
|
||||
// badly on large systems. Keep one pool thread free for this function,
|
||||
// which itself runs inside the global pool.
|
||||
int nThreads = qMin(16, QThreadPool::globalInstance()->maxThreadCount() - 1);
|
||||
int nThreads =
|
||||
qMin(16, QThreadPool::globalInstance()->maxThreadCount() - 1);
|
||||
if (pids.size() < 128 || nThreads < 2) {
|
||||
nThreads = 1;
|
||||
}
|
||||
@@ -860,8 +860,8 @@ ProcessModel::ScanResult ProcessModel::scanProcesses(
|
||||
continue;
|
||||
}
|
||||
chunks[t] = pids.mid(a, b - a);
|
||||
futures.append(QtConcurrent::run(
|
||||
[&ctx, &chunks, &outs, &uidParts, t]() {
|
||||
futures.append(
|
||||
QtConcurrent::run([&ctx, &chunks, &outs, &uidParts, t]() {
|
||||
scanChunk(ctx, chunks[t], outs[t], uidParts[t]);
|
||||
}));
|
||||
}
|
||||
@@ -880,8 +880,9 @@ ProcessModel::ScanResult ProcessModel::scanProcesses(
|
||||
}
|
||||
}
|
||||
std::sort(
|
||||
fresh.begin(), fresh.end(), [](const ProcessEntry& a,
|
||||
const ProcessEntry& b) {
|
||||
fresh.begin(),
|
||||
fresh.end(),
|
||||
[](const ProcessEntry& a, const ProcessEntry& b) {
|
||||
return a.pid < b.pid;
|
||||
});
|
||||
}
|
||||
@@ -1012,8 +1013,8 @@ void ProcessModel::applyView() {
|
||||
const FuzzyText prep = fuzzyPrepare(src.command);
|
||||
fe.commandChars = std::move(prep.chars);
|
||||
fe.commandClasses = std::move(prep.classes);
|
||||
fe.hasCommandLine =
|
||||
!src.commandLine.isEmpty() && src.commandLine != src.command;
|
||||
fe.hasCommandLine = !src.commandLine.isEmpty() &&
|
||||
src.commandLine != src.command;
|
||||
if (fe.hasCommandLine) {
|
||||
const FuzzyText prepCl = fuzzyPrepare(src.commandLine);
|
||||
fe.commandLineChars = std::move(prepCl.chars);
|
||||
|
||||
Reference in New Issue
Block a user