Remember all of that drama when Apple admitted to throttling iPhones in order to save battery life? Well, this tool is a response to that. Not only will it tell you if your phone is being slowed down, but you can also disable any throttling or use it to determine if you need your battery replaced.
Install iOS 11.3 in Settings > General > Software Update on your iPhone.
With iOS 11.3 installed on your iPhone, there's a new section on the Battery Settings page that details your battery's health. View it by going to Settings > Battery > Battery Health (Beta). There you will see your battery's current health, as well as a description of how its health impacts performance.
If your iPhone's performance is being throttled, you will see a statement similar to the one above, where you can disable the feature if you want. However, if your iPhone does randomly shut down due to battery health and performance issues, this feature will automatically enable itself once again to prevent future shutdowns.
Also worth pointing out is that if iOS is unable to determine the health level of your battery, or if the level is low enough, you will be directed to take your iPhone to an Apple Store or an authorized service center to have it tested and possibly replaced.