Environment variable set to the number of available CPU's

Looking at the list of injected environment variables I do not see one that provides information about the resource limits on the current container or VM.

I wanted to verify this is the case and ask if it would be possible to get one.

My reasoning is noted in the resource class documentation https://circleci.com/docs/2.0/configuration-reference/#resource_class

Note : Java, Erlang and any other languages that introspect the /proc directory for information about CPU count may require additional configuration to prevent them from slowing down when using the CircleCI 2.0 resource class feature. Programs with this issue may request 32 CPU cores and run slower than they would when requesting one core. Users of languages with this issue should pin their CPU count to their guaranteed CPU resources.

If there was an environment variable it would allow a way to set the number of schedulers/threads a runtime uses in a generic way, and even in an orb, instead of requiring each user to define the necessary configuration and change it depending on the resources they allocate to a job.

I can confirm this. It is impossible to get the CPU count in the bash:

        cpuset=$(cat /sys/fs/cgroup/cpuset/cpuset.cpus)
        limits=(${cpuset//-/ })
        echo "CPU count is ${TOTAL_CPUS}"
        export TOTAL_CPUS