Submit a ticketCall us

Webinar: Web Help Desk for HR, Facilities and Accounting Departments
This webinar will focus on use cases for HR, Facilities and Accounting.

Having a unified ticketing and asset management system for all the departments in your company can provide end-users with a seamless experience and make things easier for your IT team. Yet, with different business tasks and objectives, many departments don’t fully understand the capabilities of Web Help Desk and how the software can be customized for effective use in their departments.
Register Now.

Home > Success Center > Database Performance Analyzer (DPA) > Create custom charts in DPA

Create custom charts in DPA

Table of contents


This article provides brief information and steps to create custom charts (specific performance counters) in DPA. 

From time to time we have customers ask about gathering details for specific performance counters. DPA allows for this degree of customization, all it takes is a quick edit of some XML files and a little custom T-SQL code.


DPA, all versions


The following steps are for adding objects to your DPA collection in the Page Life Expectancy:

1. Create a metrics directory in {install directory}\Ignite PI\iwc\tomcat\ignite_config\idc.

2. Create two files, and name them as: 

  • {install directory}\Ignite PI\iwc\tomcat\ignite_config\idc\metrics\custom-metrics-queries.xml
  • {install directory}\Ignite PI\iwc\tomcat\ignite_config\idc\metrics\custom-metrics-properties_SQLServer.xml

3. In the custom-metrics-properties_SQLServer.xml file, add the following code, and save the file. 

<metricsProperties name="Page Life Expectancy">
  <displayName>Page Life Expectancy</displayName>
    <description>Number of seconds a page stays in buffer pool.


4. Open the custom-metrics-queries.xml file, and enter the following code. This code will run the T-SQL to get the desired performance counter Page Life Expectancy:

<metricsQuery className="com.confio.idc.database.metrics.domain.queries.
        select cntr_value
        from sys.dm_os_performance_counters
        where counter_name = 'Page life expectancy'
        and object_name like '%Buffer Manager%'
  <name>Page Life Expectancy</name>
     <databaseType>SQL Server</databaseType>


Additional Information:

The sys.dm_os_performance_counters DMV contains a number of objects found in System Monitor.

If you what you need is NOT in the DMV, for example, Avg. Disk sec/Read, you can use some WMI objects using sp_OA.


The following example should help customize DPA collections, especially if the counter is already available in the sys.dm_os_performance_counters DMV.


<metricsQuery className="com.confio.idc.database.metrics.domain.queries.
        DECLARE @WmiServiceLocator INT ,
                @WmiService INT ,
                @CounterObject INT ,
                @DiskSecPerRead BIGINT ,
                @DiskSecPerRead_Base BIGINT ,
                @DiskSecPerWrite BIGINT ,
                @DiskSecPerWrite_Base BIGINT

        EXEC sp_OACreate 'WbemScripting.SWbemLocator',
@WmiServiceLocator OUTPUT, 5

        EXEC sp_OAMethod @WmiServiceLocator, 'ConnectServer',
@WmiService OUTPUT, '.', 'root\cimv2'

        IF ISNULL(@WmiService, -1) <= 0
              EXEC sp_OADestroy @WmiServiceLocator
                 RAISERROR('Could not access WMI service.
See:', 16, 1)

        EXEC sp_OAMethod @WmiService, 'Get', @CounterObject OUTPUT,

        EXEC sp_OAGetProperty @CounterObject, 'AvgDiskSecPerRead',
@DiskSecPerRead OUTPUT
        EXEC sp_OAGetProperty @CounterObject, 'AvgDiskSecPerRead_Base',
@DiskSecPerRead_Base OUTPUT
        EXEC sp_OAGetProperty @CounterObject, 'AvgDiskSecPerWrite',
@DiskSecPerWrite OUTPUT
        EXEC sp_OAGetProperty @CounterObject, 'AvgDiskSecPerWrite_Base',
@DiskSecPerWrite_Base OUTPUT

        EXEC sp_OADestroy @CounterObject
        EXEC sp_OADestroy @WmiService
        EXEC sp_OADestroy @WmiServiceLocator  

        IF @DiskSecPerRead IS NULL OR @DiskSecPerWrite IS NULL
              RAISERROR('Could not access WMI counter:
See:', 16, 1)

        SELECT @DiskSecPerRead, @DiskSecPerRead_Base, @DiskSecPerWrite,
            <metric name="DiskSecPerRead">
.divide(TEN, BigDecimal.ROUND_HALF_DOWN).divide(args[1],
            <metric name="DiskSecPerWrite">
.divide(TEN, BigDecimal.ROUND_HALF_DOWN).divide(args[3],
            <databasetype>SQL Server</databasetype>



If you need to get additional counters not in that DMV then you need to resort to other methods to pull the data from the OS. 

You can use WMICodeCreator tool available for free from Microsoft.

Last modified
14:57, 20 Oct 2017