KCGroups
kapplicationscope.cpp
18 static const Property<OptionalQULongLong> cpuQuotaPeriodProp = {&KApplicationScopePrivate::m_cpuQuotaPeriod,
24 static const Property<OptionalQULongLong> cpuWeightProp = {&KApplicationScopePrivate::m_cpuWeight,
36 static const Property<OptionalQULongLong> memoryLowProp = {&KApplicationScopePrivate::m_memoryLow,
42 static const Property<OptionalQULongLong> memoryHighProp = {&KApplicationScopePrivate::m_memoryHigh,
48 static const Property<OptionalQULongLong> memoryMinProp = {&KApplicationScopePrivate::m_memoryMin,
54 static const Property<OptionalQULongLong> memoryMaxProp = {&KApplicationScopePrivate::m_memoryMax,
60 static const Property<OptionalQULongLong> memorySwapMaxProp = {&KApplicationScopePrivate::m_memorySwapMax,
238 org::freedesktop::systemd1::Manager manager(systemd1, systemd1Path, QDBusConnection::sessionBus());
250 KApplicationScopePrivate::KApplicationScopePrivate(const QString &path, const QString &id, KApplicationScope *parent)
255 , m_unit(new org::freedesktop::systemd1::Unit(systemd1, path, QDBusConnection::sessionBus(), q_ptr))
256 , m_properties(new org::freedesktop::DBus::Properties(systemd1, path, QDBusConnection::sessionBus(), q_ptr))
266 const auto *getAllWatcher = new QDBusPendingCallWatcher(m_properties->GetAll(interface), q_ptr);
267 QObject::connect(getAllWatcher, &QDBusPendingCallWatcher::finished, q_ptr, [this](QDBusPendingCallWatcher *w) {
271 const auto *unitGetAllWatcher = new QDBusPendingCallWatcher(m_properties->GetAll(systemd1Unit));
272 QObject::connect(unitGetAllWatcher, &QDBusPendingCallWatcher::finished, q_ptr, [this](QDBusPendingCallWatcher *w) {
277 static const QRegularExpression appPattern(QStringLiteral("^apps?-(.+?)(?:-([^-]+))?\\.(scope|service|slice)$"));
292 name.replace(offset + escapedMatch.capturedStart(), escapedMatch.capturedLength(), QLatin1Char(byte));
351 QObject::connect(watcher, &QDBusPendingCallWatcher::finished, q_ptr, [this](QDBusPendingCallWatcher *watcher) {
359 const auto *watcher = new QDBusPendingCallWatcher(m_unit->Stop(QStringLiteral("replace")), q_ptr);
360 QObject::connect(watcher, &QDBusPendingCallWatcher::finished, q_ptr, [this](QDBusPendingCallWatcher *watcher) {
365 void KApplicationScopePrivate::handleVoidCallFinished(QDBusPendingCallWatcher *call, KApplicationScope::ErrorCode code)
441 void KApplicationScopePrivate::setError(KApplicationScope::ErrorCode code, const QString &message, const bool warning)
bool isNull() const const
void finished(QDBusPendingCallWatcher *self)
void setCpuQuotaPeriod(const OptionalQULongLong &period)
set cpuQuotaPeriod
Definition: kapplicationscope.cpp:179
OptionalQULongLong cpuQuotaPeriod
duration in micoseconds over which the CPU time quota is measured.
Definition: kapplicationscope.h:90
void stop(Ekos::AlignState mode)
QString message() const const
T value() const const
QString cgroup
file path of the control group in /sys/fs/cgroup @accessors cgroup() @notifySignal cgroupChanged()
Definition: kapplicationscope.h:41
QString chopped(int len) const const
void setMemoryLow(const OptionalQULongLong &memoryLow)
set memoryLow
Definition: kapplicationscope.cpp:194
bool isError() const const
KGuiItem properties()
void memorySwapMaxChanged(const OptionalQULongLong &memorySwapMax)
emitted when memorySwapMax has changed
OptionalQULongLong memoryHigh
throttling limit on memory usage (in bytes) of all executed processes within the application.
Definition: kapplicationscope.h:118
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
OptionalQULongLong memorySwapMax
absolute limit on swap usage (in bytes) of all executed processes within the application.
Definition: kapplicationscope.h:139
void ioWeightChanged(const OptionalQULongLong &weight)
emitted when the io weight has changed
void deleteLater()
A desktop application in a systemd transient scope.
Definition: kapplicationscope.h:19
QDBusConnection sessionBus()
Property
void memoryMinChanged(const OptionalQULongLong &memoryMin)
emitted when memoryMin has changed
void setMemoryMax(const OptionalQULongLong &memoryMax)
set memoryMax
Definition: kapplicationscope.cpp:209
OptionalQULongLong memoryMin
memory usage protection (in bytes) of all executed processes within the application.
Definition: kapplicationscope.h:125
OptionalQULongLong memoryLow
best-effort memory usage protection (in bytes) of all executed processes within the application.
Definition: kapplicationscope.h:111
static KApplicationScope * fromPid(uint pid, QObject *parent=nullptr)
Use when only PID is known.
Definition: kapplicationscope.cpp:236
void memoryLowChanged(const OptionalQULongLong &memoryLow)
emitted when memoryLow has changed
KApplicationScope(const QString &path, QObject *parent=nullptr)
Use when only path is known.
Definition: kapplicationscope.cpp:84
void cpuWeightChanged(const OptionalQULongLong &weight)
emitted when the cpu weight has changed
OptionalQULongLong memoryMax
absolute limit on memory usage (in bytes) of all executed processes within the application.
Definition: kapplicationscope.h:132
QRegularExpressionMatch match(const QString &subject, int offset, QRegularExpression::MatchType matchType, QRegularExpression::MatchOptions matchOptions) const const
QString fileName() const const
QDBusError error() const const
void cpuQuotaPeriodChanged(const OptionalQULongLong &period)
emitted when the cpu quota period has changed
void setMemoryHigh(const OptionalQULongLong &memoryHigh)
set memoryHigh
Definition: kapplicationscope.cpp:199
void cpuQuotaChanged(const OptionalQULongLong "a)
emitted when the cpu quota has changed
KCOREADDONS_EXPORT Result match(QStringView pattern, QStringView str)
const char * name(StandardAction id)
QString desktopFilePath
the application .desktop file if available.
Definition: kapplicationscope.h:62
void setMemoryMin(const OptionalQULongLong &memoryMin)
set memoryMin
Definition: kapplicationscope.cpp:204
OptionalQULongLong cpuQuota
cpu quota for cpu controller, in microseconds per second (1000000 means 100%).
Definition: kapplicationscope.h:83
QVariant argumentAt(int index) const const
void memoryMaxChanged(const OptionalQULongLong &memoryMax)
emitted when memoryMax has changed
void setMemorySwapMax(const OptionalQULongLong &memorySwapMax)
set memorySwapMax
Definition: kapplicationscope.cpp:214
QObject * parent() const const
QString message
void memoryHighChanged(const OptionalQULongLong &memoryHigh)
emitted when memoryHigh has changed
ErrorCode lastError
code of the last error that occurred (NoError if none) @accessors lastError() @notifySignal errorOccu...
Definition: kapplicationscope.h:76
void setCpuWeight(const OptionalQULongLong &weight)
set cpuWeight
Definition: kapplicationscope.cpp:184
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Dec 1 2023 04:13:56 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Dec 1 2023 04:13:56 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.