How to use the cgroupspy.interfaces.TypedFile 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 / controllers.py View on Github external
# numa_stat =

    # Requires eventfd handling - https://www.kernel.org/doc/Documentation/cgroups/memory.txt
    # pressure_level =


class DevicesController(Controller):
    """
    devices.allow
    devices.deny
    devices.list
    """

    allow = TypedFile("devices.allow", DeviceAccess, writeonly=True)
    deny = TypedFile("devices.deny", DeviceAccess, writeonly=True)
    list = TypedFile("devices.list", DeviceAccess, readonly=True, many=True)


class BlkIOController(Controller):
    """
    blkio.io_merged
    blkio.io_merged_recursive
    blkio.io_queued
    blkio.io_queued_recursive
    blkio.io_service_bytes
    blkio.io_service_bytes_recursive
    blkio.io_serviced
    blkio.io_serviced_recursive
    blkio.io_service_time
    blkio.io_service_time_recursive
    blkio.io_wait_time
    blkio.io_wait_time_recursive
github cloudsigma / cgroupspy / cgroupspy / interfaces.py View on Github external
def __init__(self, filename, contenttype, readonly=None, writeonly=None, many=False):
        if not issubclass(contenttype, BaseContentType):
            raise RuntimeError("Contenttype should be a class inheriting "
                               "from BaseContentType, not {}".format(contenttype))

        self.contenttype = contenttype
        self.many = many
        super(TypedFile, self).__init__(filename, readonly=readonly, writeonly=writeonly)
github cloudsigma / cgroupspy / cgroupspy / controllers.py View on Github external
io_serviced = SplitValueFile("blkio.io_serviced", 1, int)
    io_serviced_recursive = SplitValueFile("blkio.io_serviced_recursive", 1, int)
    io_service_time = SplitValueFile("blkio.io_service_time", 1, int)
    io_service_time_recursive = SplitValueFile("blkio.io_service_time_recursive", 1, int)
    io_wait_time = SplitValueFile("blkio.io_wait_time", 1, int)
    io_wait_time_recursive = SplitValueFile("blkio.io_wait_time_recursive", 1, int)
    leaf_weight = IntegerFile("blkio.leaf_weight")
    # TODO: Uncomment the following properties after researching how to interact with files
    # leaf_weight_device =
    reset_stats = IntegerFile("blkio.reset_stats")
    # sectors =
    # sectors_recursive =
    # throttle_io_service_bytes =
    # throttle_io_serviced =
    throttle_read_bps_device = TypedFile("blkio.throttle.read_bps_device", contenttype=DeviceThrottle, many=True)
    throttle_read_iops_device = TypedFile("blkio.throttle.read_iops_device", contenttype=DeviceThrottle, many=True)
    throttle_write_bps_device = TypedFile("blkio.throttle.write_bps_device ", contenttype=DeviceThrottle, many=True)
    throttle_write_iops_device = TypedFile("blkio.throttle.write_iops_device ", contenttype=DeviceThrottle, many=True)
    # time =
    # time_recursive =
    weight = IntegerFile("blkio.weight")
    # weight_device =


class NetClsController(Controller):

    """
    net_cls.classid
    """
    class_id = IntegerFile("net_cls.classid")
github cloudsigma / cgroupspy / cgroupspy / controllers.py View on Github external
io_service_time = SplitValueFile("blkio.io_service_time", 1, int)
    io_service_time_recursive = SplitValueFile("blkio.io_service_time_recursive", 1, int)
    io_wait_time = SplitValueFile("blkio.io_wait_time", 1, int)
    io_wait_time_recursive = SplitValueFile("blkio.io_wait_time_recursive", 1, int)
    leaf_weight = IntegerFile("blkio.leaf_weight")
    # TODO: Uncomment the following properties after researching how to interact with files
    # leaf_weight_device =
    reset_stats = IntegerFile("blkio.reset_stats")
    # sectors =
    # sectors_recursive =
    # throttle_io_service_bytes =
    # throttle_io_serviced =
    throttle_read_bps_device = TypedFile("blkio.throttle.read_bps_device", contenttype=DeviceThrottle, many=True)
    throttle_read_iops_device = TypedFile("blkio.throttle.read_iops_device", contenttype=DeviceThrottle, many=True)
    throttle_write_bps_device = TypedFile("blkio.throttle.write_bps_device ", contenttype=DeviceThrottle, many=True)
    throttle_write_iops_device = TypedFile("blkio.throttle.write_iops_device ", contenttype=DeviceThrottle, many=True)
    # time =
    # time_recursive =
    weight = IntegerFile("blkio.weight")
    # weight_device =


class NetClsController(Controller):

    """
    net_cls.classid
    """
    class_id = IntegerFile("net_cls.classid")


class NetPrioController(Controller):