KCGroups
kapplicationscope.cpp
18static const Property<OptionalQULongLong> cpuQuotaPeriodProp = {&KApplicationScopePrivate::m_cpuQuotaPeriod,
24static const Property<OptionalQULongLong> cpuWeightProp = {&KApplicationScopePrivate::m_cpuWeight,
36static const Property<OptionalQULongLong> memoryLowProp = {&KApplicationScopePrivate::m_memoryLow,
42static const Property<OptionalQULongLong> memoryHighProp = {&KApplicationScopePrivate::m_memoryHigh,
48static const Property<OptionalQULongLong> memoryMinProp = {&KApplicationScopePrivate::m_memoryMin,
54static const Property<OptionalQULongLong> memoryMaxProp = {&KApplicationScopePrivate::m_memoryMax,
60static const Property<OptionalQULongLong> memorySwapMaxProp = {&KApplicationScopePrivate::m_memorySwapMax,
238 org::freedesktop::systemd1::Manager manager(systemd1, systemd1Path, QDBusConnection::sessionBus());
250KApplicationScopePrivate::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) {
277static 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) {
365void KApplicationScopePrivate::handleVoidCallFinished(QDBusPendingCallWatcher *call, KApplicationScope::ErrorCode code)
441void KApplicationScopePrivate::setError(KApplicationScope::ErrorCode code, const QString &message, const bool warning)
A desktop application in a systemd transient scope.
Definition kapplicationscope.h:20
OptionalQULongLong memoryMin
memory usage protection (in bytes) of all executed processes within the application.
Definition kapplicationscope.h:125
OptionalQULongLong memoryHigh
throttling limit on memory usage (in bytes) of all executed processes within the application.
Definition kapplicationscope.h:118
void ioWeightChanged(const OptionalQULongLong &weight)
emitted when the io weight has changed
KApplicationScope(const QString &path, QObject *parent=nullptr)
Use when only path is known.
Definition kapplicationscope.cpp:84
OptionalQULongLong cpuQuotaPeriod
duration in micoseconds over which the CPU time quota is measured.
Definition kapplicationscope.h:90
void memoryMaxChanged(const OptionalQULongLong &memoryMax)
emitted when memoryMax has changed
QString cgroup
file path of the control group in /sys/fs/cgroup @accessors cgroup() @notifySignal cgroupChanged()
Definition kapplicationscope.h:41
void cpuQuotaPeriodChanged(const OptionalQULongLong &period)
emitted when the cpu quota period has changed
void setMemorySwapMax(const OptionalQULongLong &memorySwapMax)
set memorySwapMax
Definition kapplicationscope.cpp:214
OptionalQULongLong cpuQuota
cpu quota for cpu controller, in microseconds per second (1000000 means 100%).
Definition kapplicationscope.h:83
void setCpuQuotaPeriod(const OptionalQULongLong &period)
set cpuQuotaPeriod
Definition kapplicationscope.cpp:179
void cpuWeightChanged(const OptionalQULongLong &weight)
emitted when the cpu weight has changed
void setMemoryHigh(const OptionalQULongLong &memoryHigh)
set memoryHigh
Definition kapplicationscope.cpp:199
OptionalQULongLong memorySwapMax
absolute limit on swap usage (in bytes) of all executed processes within the application.
Definition kapplicationscope.h:139
ErrorCode lastError
code of the last error that occurred (NoError if none) @accessors lastError() @notifySignal errorOccu...
Definition kapplicationscope.h:76
OptionalQULongLong memoryMax
absolute limit on memory usage (in bytes) of all executed processes within the application.
Definition kapplicationscope.h:132
void setMemoryMax(const OptionalQULongLong &memoryMax)
set memoryMax
Definition kapplicationscope.cpp:209
void setMemoryMin(const OptionalQULongLong &memoryMin)
set memoryMin
Definition kapplicationscope.cpp:204
OptionalQULongLong memoryLow
best-effort memory usage protection (in bytes) of all executed processes within the application.
Definition kapplicationscope.h:111
void cpuQuotaChanged(const OptionalQULongLong "a)
emitted when the cpu quota has changed
void memoryHighChanged(const OptionalQULongLong &memoryHigh)
emitted when memoryHigh has changed
void memorySwapMaxChanged(const OptionalQULongLong &memorySwapMax)
emitted when memorySwapMax has changed
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
void setCpuWeight(const OptionalQULongLong &weight)
set cpuWeight
Definition kapplicationscope.cpp:184
void memoryMinChanged(const OptionalQULongLong &memoryMin)
emitted when memoryMin has changed
void setMemoryLow(const OptionalQULongLong &memoryLow)
set memoryLow
Definition kapplicationscope.cpp:194
KCOREADDONS_EXPORT Result match(QStringView pattern, QStringView str)
QString name(StandardAction id)
KGuiItem properties()
QDBusConnection sessionBus()
QString message() const const
void finished(QDBusPendingCallWatcher *self)
QVariant argumentAt(int index) const const
QDBusError error() const const
bool isError() const const
QString fileName() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
QObject * parent() const const
QRegularExpressionMatch match(QStringView subjectView, qsizetype offset, MatchType matchType, MatchOptions matchOptions) const const
QString chopped(qsizetype len) const const
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
bool isNull() const const
T value() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.