You can detect thermal throttling with the following bash command:
`vcgencmd get_throttled`
A return value of `0x0` means no throttling has occurred since the last reboot. Any non-zero value indicates the Pi has throttled at some point. You can run this command while the Pi is under load to see if throttling is occurring.