There are three ways how performance counters for a Kentico CMS instance can be registered in Windows.
The first option of registering performance counters for an instance of Kentico CMS is in Step 4 of the Web Installer. In this step, you can see the Register performance counters for Health Monitoring check-box. If you enable it, performance counters will be registered for the currently installed instance of Kentico CMS.
Check the Install Windows services for Scheduler and Health Monitoring option to install the Kentico CMS Scheduler and Kentico CMS Health Monitor services. Installing the service can optimize your application's performance.
When the Windows service is launched or restarted, it checks if performance counter categories for the respective Kentico CMS instance are registered. If it detects that they are not registered, it performs their registration automatically.
When the Windows service is running, it also monitors creation, editing and deletion of .xpc files located anywhere in the folder structure under ~\App_Data\CMSModules\. When an .xpc file in this location is created, edited or deleted, the Windows services performs reload of all counters in both counter categories, ensuring that registered counters match the counters defined in the .xpc files.
It is also possible to register performance counters manually. This can be done by going to the Bin folder of your current Kentico CMS project folder (typically C:\inetpub\wwwroot\KenticoCMS\bin) and executing the HealthMonitoringService.exe file from Windows command line with the following parameters:
HealthMonitoringService.exe /webpath="<disk path to web project root>" /createcounters
Similarly, you can use the HealthMonitoringService.exe file to remove already registered counters. This is done by executing the file with parameters as follows:
HealthMonitoringService.exe /webpath="<disk path to web project root>" /deletecounters
Registration of performance counters is technically performed by adding specific keys to Windows registry. In the registry, they are located in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services. The keys represent individual registered counter categories and have the same names as the respective registered counter categories. By deleting the registry keys, you perform removal of the respective counter categories so that they are no longer registered.