Open alexlarsson opened 1 year ago
Here is the cgtop code: https://github.com/systemd/systemd/blob/main/src/cgtop/cgtop.c
After an initial, brief research looking at the cgtop source code and other documentation it turns out that the functionality of cgtop
is only provided via the CLI tool - there is no D-Bus API providing these kind of information directly.
The cgtop
code itself is quite tightly tied into the systemd's library, so copying (and changing the code to our needs) would result in basically copying a huge part of systemds code base. Therefore, this is probably not a reasonable solution.
Another option could be to extend cgtop in systemd, e.g. building another binary and wrapping it in a systemd service, so that it provides a D-Bus interface with the required information - either via PR to systemd itself or in a fork.
There are probably more options to implement this, but considering the high complexity and effort needed as well as the (currently) low priority this issue is deprioritized for now.
I.e. ability to get this kind of data from any node when you are on the manager node.
I'm not sure what apis systemd-cgtop uses, but it may very well be that it only uses the systemd properties that are already exposed by hirte, and all we need is a client application which collects this information.