I can’t speak to the other executors, but I was able to determine the number of “vCPUs” available in my docker executor environment by inspecting cgroup configuration:
echo $(($(cat /sys/fs/cgroup/cpu/cpu.shares) / 1024))
Of course, it would be much nicer to have this info exposed through /proc or at least as an environment variable.