How to use the cgroupspy.utils.walk_tree 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 / trees.py View on Github external
def walk(self, root=None):
        if root is None:
            root = self.control_root
        return walk_tree(root)
github cloudsigma / cgroupspy / cgroupspy / nodes.py View on Github external
def walk(self):
        """Walk through this node and its children - pre-order depth-first"""
        return walk_tree(self)
github cloudsigma / cgroupspy / cgroupspy / nodes.py View on Github external
def group_tasks(self):
        """All tasks in the hierarchy, affected by this group."""
        tasks = set()
        for node in walk_tree(self):
            for ctrl in node.controllers.values():
                tasks.update(ctrl.tasks)
        return tasks
github cloudsigma / cgroupspy / cgroupspy / trees.py View on Github external
def walk(self, root=None):
        """Walk through each each node - pre-order depth-first"""

        if root is None:
            root = self.root
        return walk_tree(root)