Performance Toolkit in Business Central – Part 3

Performance Toolkit in Business Central – Part 3

This last blog about the performance toolkit I will talk about how you can run it but also how you can extract te results.

You can start the BCPT suite in two ways. The first is just from the UI:

Geen alternatieve tekst opgegeven voor deze afbeelding

If you are running it from the UI the sessions will always run sequential (when you hit the ‘start’ button). So that is not a very good test. But you must always do a first run that you don’t calculate in your measurements. In this first run BC cannot use his cache and so the numbers from your first run are always higher then your second run.

If you want to do a first test run just hit the button “Start in Single Run mode”. In this way all the codeunits will only run one time and BC is filling his cache.

The second way to start the BCPT tool is throught PowerShell. Examples of running the PowerShell script against a Docker Container of a Sandbox are different. Below you can find an example:

Geen alternatieve tekst opgegeven voor deze afbeelding

For a sandbox you have to get an “app registration” in your Azure Portal of the type Delegated:

Geen alternatieve tekst opgegeven voor deze afbeelding

Once you have done that you can start the BCPT Tool:

Geen alternatieve tekst opgegeven voor deze afbeelding

Between every session there is a 2 seconds delay when is starts the next session.

(The PowerShell scripts you can find on the DVD in the folder “Applications\testframework\TestRunner”)

Now you know how you can start it and once you are finished you can analyse the results. This can be done straight from the UI en export the “Log Entries” to Excel.

Geen alternatieve tekst opgegeven voor deze afbeelding
Geen alternatieve tekst opgegeven voor deze afbeelding

In this case you can see what the initial run is and the second run. But also you can find out scenario’s if an extension will increase the performance or setting up the change log.

But if you put the application connection string in your admin portal these log entries are also logged into application insights. The eventId that you need to search on is “AL0000DGF”. In the customDimension you can see all the values that are also in the “Log Entries”:

Geen alternatieve tekst opgegeven voor deze afbeelding

Except the error message because this can contain GDPR information that you don’t want in your log files.

So in this way if you run it from a Docker Container you can remove it and still analyse the results. An example what we use is measure the grown in percentage of the SQL statements. And if the grow is very large we get a tricker (with a logic app):

Geen alternatieve tekst opgegeven voor deze afbeelding

And maybe the latest development is that you can run the Performance Toolkit in Visual Studio Code. This is not avialable. But I hope it will get there soon.

Because if you test the performance by forehand your customer will be very happy!

The previous blogs about BCPT you can find here:

Leave a Reply

Your email address will not be published.