How to use the cgroupspy.nodes.NodeControlGroup function in cgroupspy

To help you get started, we’ve selected a few cgroupspy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudsigma / cgroupspy / cgroupspy / nodes.py View on Github external
tasks = set()
        for node in walk_tree(self):
            for ctrl in node.controllers.values():
                tasks.update(ctrl.tasks)
        return tasks

    @property
    def tasks(self):
        """Tasks in this exact group"""
        tasks = set()
        for ctrl in self.controllers.values():
            tasks.update(ctrl.tasks)
        return tasks


class NodeVM(NodeControlGroup):

    """Abstraction of a QEMU virtual machine node."""

    @property
    def verbose_name(self):
        try:
            return self.nodes[0].verbose_name
        except:
            return "AnonymousVM"

    @property
    def emulator(self):
        return self.children_map.get("emulator", None)

    @property
    def vcpus(self):
github cloudsigma / cgroupspy / cgroupspy / trees.py View on Github external
def __init__(self, root_path=b"/sys/fs/cgroup", groups=None, sub_groups=None):

        self.node_tree = BaseTree(root_path=root_path, groups=groups, sub_groups=sub_groups)
        self.control_root = NodeControlGroup(name=b"cgroup")
        for ctrl in self.node_tree.root.children:
            self.control_root.add_node(ctrl)

        self._init_control_tree(self.control_root)
github cloudsigma / cgroupspy / cgroupspy / trees.py View on Github external
def _create_node(self, name, parent):
        return NodeControlGroup(name, parent=parent)