Performance Toolkit in Business Central – Part 1
This blog I want to write a long time ago. But now it is finally there (for part 1). This one is about the Performance Toolkit. With Application Insights you always check the performance if your app is installed at the customer. But you want to check if your app is performing upfront. Well with the performance toolkit you can tell yourself “how many users can handle this function. And maybe more functions together”. So if you are making a change you can run the performance toolkit and see if the sql statements is increased and the total ms.
First we look into how you can set it up. In a later blog I will explain the test codeunits and how you start the tool.
The Performance Toolkit you can download from the extension management or it is delivered on the DVD. There is one note to mentioned. The Performance Toolkit you can only use on a sandbox or in an on-premise environment. Also it has an dependency on the “Test Runner” extension.
Ones it is installed you can search for BCPT and you can start filling up your first test:
First insert a code and a clear description. But also how long you want to run the tool. On the lines you can enter all your tests (in part 2 I will get to the AL code in the test codeunits). Also you can put here the number of sessions which it must executed. And if you want to mimic a real user scenario you can change the “Min. User Delay (ms)”, “Max. User Delay (ms)” and the “Delay between itterations sec.”. With the delay type you have fixed of random. With fixed you can set a fixed number of itterations that must be excucted. So if you want the excute it only ones and the duration is 60 minutes just enter 3600 with a fixed delay.
After you have set it up just perform a “single run” just to warm-up the system. The logs you can find also on the page:
But if you attach “Application Insights” in your NST the logs are also exported to your “Application Insights” and you can search on code “AL0000DGF” (later on more):
So that is a little start of what the Performance Toolkit is. But if you want to start with a customer you must first explorer what it the customer using. Also if you want set it up for your own testing (in your pipelines) look at a couple of customers what they are doing each day of the week. See below graph:
So with this you can see what the users are doing per day. And with this you search for the highest session per process. With this information you can fill in an Excel sheet as for example below:
In these test we are using the following metrics:
- Role Center -> 2-5 sec
- List Page -> 2-5 sec
- Card -> 2-5 sec
- Field validation 0.5-1 sec
- Key press -> < 100ms
Now you can start creating those test codeunits. That is in part 2 of this blog. Keep on testing 🙂