the IDE reads the file /proc/xenomai/stat and gets the CPU usage of the bela-audio thread and of the other real-time threads. I think it also goes as far as taking the PID of the other threads from that same file and doing some Linux stuff to find out if they are using any CPU in "Linux" mode.
(checkout Bela/IDE/libs/IDEProcesses.js).
Ultimately, if you only have the audio thread ( or only care about monitoring that one), you can use something liks this:
grep bela-audio /proc/xenomai/stat | sed "s/\s\{1,\}/ /g" | cut -d" " -f 9
though I am not sure about the last number: that will have to correspond to the column with the CPU usage. Check by first doing
cat /proc/xenomai/stat