import time


def docker_abs_cpu(container_id):
    """
    Returns the used CPU time since container startup and the system time in nanoseconds and returns the number
    of available CPU cores.

    :param container_id: The full ID of the docker container.
    :type container_id: ``str``
    :return: Returns a dict with CPU_used in nanoseconds, the current system time in nanoseconds and the number of
        CPU cores available.
    :rtype: ``dict``
    """
    with open('/sys/fs/cgroup/cpuacct/docker/' + container_id + '/cpuacct.usage_percpu', 'r') as f:
        line = f.readline()
    sys_time = int(time.time() * 1000000000)
    numbers = [int(x) for x in line.split()]
    cpu_usage = 0
    for number in numbers:
        cpu_usage += number
    return {'CPU_used': cpu_usage,
            'CPU_used_systime': sys_time, 'CPU_cores': len(numbers)}