'Return the container MEMORY.
Input: id is the full container id
all_stats is the output of the stats method of the Docker API
Output: a dict {\'rss\': 1015808, \'cache\': 356352,  \'usage\': ..., \'max_usage\': ...}'

def get_docker_memory(self, container_id, all_stats):

    ret = {}
    try:
        ret['usage'] = all_stats['memory_stats']['usage']
        ret['limit'] = all_stats['memory_stats']['limit']
        ret['max_usage'] = all_stats['memory_stats']['max_usage']
    except (KeyError, TypeError) as e:
        logger.debug('docker    plugin    -    Cannot    grab    MEM    usage    for    container    {}    ({})'.format(container_id, e))
        logger.debug(all_stats)
    return ret
