def get_io_service_bytes(container, device):
    """ Measure the value of io.io_service_bytes for the given device in the
        given container.
    """
    total = 0
    for line in container.get_attr('io_service_bytes'):
        parts = line.split()
        if parts[0] == device and parts[1] == 'Total':
            total = float(parts[2])
    return total