Re: KCGroups in KDEreview

2020-11-26 Thread Henri Chain
On Saturday, November 21, 2020 1:38:47 AM CET Albert Astals Cid wrote:
> El divendres, 20 de novembre de 2020, a les 14:55:16 CET, Henri Chain va 
escriure:
> > Hello everyone,
> > 
> > KCgroups has been moved to KDEReview !
> > What is that, you ask ? It's a library that wraps the systemd dbus API to
> > expose a higher-level concept of desktop application and allow control of
> > its system resource usage (CPU, RAM, IO, etc).
> > 
> > It relies on the recent ability of plasma to launch applications in their
> > own systemd scopes, with correspond to cgroups and provides a more robust
> > definition for an application (more details at
> > https://lwn.net/Articles/834329/ ) .
> > 
> > The main use of the library is to expose related resource control settings
> > for those applications, at a user space level that other KDE applications
> > and frameworks can use, including consumption straight from QML as
> > demonstrated in the test application.
> > 
> > KCgroups is intended to become a (Tier 1) framework. A first user of this
> > library might be the foreground window CPU booster daemon that is
> > available
> > here:
> > https://invent.kde.org/libraries/kcgroups/-/tree/work/foreground-booster
> > 
> > Packages are already available for both Neon and Arch Linux.
> > 
> > Looking forward to your feedback and ideas for using this,
> 
> I'm a bit scared about your optional class being there all in the main
> namespace. I'd suggest putting in some "namespace kcgroups{}" or name it
> kcgoptional or something.

Fixed in https://invent.kde.org/libraries/kcgroups/-/commit/
1e0a6576a75b3f1f94ee62cf24e1818ace739e29 .
The optional implementation was intended to be a stopgap for c++14 and be 
fully compatible with the std implementation. I put it in its own namespace, 
and changed the includes to use the std implementation when available

> 
> you have a few properties without NOTIFY, ideally you should either add it
> if they can change or mark them as CONSTANT if they can't.

Clazy reports warnings mostly on the interfaces generated by qtdbusxml2cpp. 
The NOTIFYs are truly missing from the underlying  dbus interface, which is a 
design choice of systemd (and they aren't constant either). There was one 
missing CONSTANT which was my fault however, fixed that in https://
invent.kde.org/libraries/kcgroups/-/commit/
d2130d24587a01237c892cfc4602e59102104e66

Thanks for the review!
Henri

> 
> Cheers,
>   Albert
> 
> > Henri






Re: KCGroups in KDEreview

2020-11-26 Thread Henri Chain
On Friday, November 20, 2020 8:29:33 PM CET Jacky Alcine wrote:
> This is exciting! Is it needed to explicitly put "cgroups" in the name?
> (What I'm really asking is if there's a way to have this work in a
> cross-platform way)

Yes, this library takes advantage of cgroups resource control, and nothing 
truly comparable exists outside of linux. It does so by leveraging systemd 
which is also a requirement.
The process grouping part can probably be ported however. Windows and Mac OS X 
both have this kind of thing, but it might require escalation.
I currently don't have plans to make this a platform independent library but 
it could be a long term goal.

> On Fri, Nov 20, 2020, at 05:55, Henri Chain wrote:
> > Hello everyone,
> > 
> > KCgroups has been moved to KDEReview !
> > What is that, you ask ? It's a library that wraps the systemd dbus API to
> > expose a higher-level concept of desktop application and allow control of
> > its system resource usage (CPU, RAM, IO, etc).
> > 
> > It relies on the recent ability of plasma to launch applications in their
> > own systemd scopes, with correspond to cgroups and provides a more robust
> > definition for an application (more details at
> > https://lwn.net/Articles/834329/ ) .
> > 
> > The main use of the library is to expose related resource control settings
> > for those applications, at a user space level that other KDE applications
> > and frameworks can use, including consumption straight from QML as
> > demonstrated in the test application.
> > 
> > KCgroups is intended to become a (Tier 1) framework. A first user of this
> > library might be the foreground window CPU booster daemon that is
> > available
> > here:
> > https://invent.kde.org/libraries/kcgroups/-/tree/work/foreground-booster
> > 
> > Packages are already available for both Neon and Arch Linux.
> > 
> > Looking forward to your feedback and ideas for using this,
> > Henri