Skip to content

Added info about how counters work #4247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ ms.author: jrasnick

Some objects have several instances if multiple resources of a given type exist on the computer. For example, the **Processor** object type will have multiple instances if a system has multiple processors. The **Databases** object type has one instance for each database on [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Some object types (for example, the **Memory Manager** object) have only one instance. If an object type has multiple instances, you can add counters to track statistics for each instance, or in many cases, all instances at once. Counters for the default instance appear in the format **SQLServer:**_\<object name>_. Counters for named instances appear in the format **MSSQL$**_\<instance name>_**:**_\<counter name>_ or **SQLAgent$**_\<instance name>_**:**_\<counter name>_.

[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] performance counter values are generated using the Windows Performance Counter (WPC) engine. Some counter values are not calculated directly by [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)]. The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] provides base values to the WPC engine, which will perform the required calculations (like percentages). The [sys.dm_os_performance_counters &#40;Transact-SQL&#41;](../../relational-databases/system-dynamic-management-views/sys-dm-os-performance-counters-transact-sql.md) dynamic management view provides all counters with the original value generated by [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. The `cntr_type` column indicates the type of counter. How the WPC engine processes [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] counter values depends on this type. For more information about performance counter types, see the [WMI documentation](https://docs.microsoft.com/windows/win32/wmisdk/wmi-performance-counter-types).

By adding or removing counters to the chart and saving the chart settings, you can specify the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] objects and counters that are monitored when System Monitor is started.

You can configure System Monitor to display statistics from any [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] counter. In addition, you can set a threshold value for any [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] counter and then generate an alert when a counter exceeds a threshold. For more information about setting an alert, see [Create a SQL Server Database Alert](../../relational-databases/performance-monitor/create-a-sql-server-database-alert.md).

> [!TIP]
> You can also return the performance counter values by querying the [sys.dm_os_performance_counters &#40;Transact-SQL&#41;](../../relational-databases/system-dynamic-management-views/sys-dm-os-performance-counters-transact-sql.md) dynamic management view.


> [!NOTE]
> [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] statistics are displayed only when an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is installed. If you stop and restart an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], the display of statistics is interrupted and resumes automatically. Also note that you will see [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] counters in the System Monitor snap-in even if [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is not running. On a clustered instance, performance counters only function on the node where [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is running.
Expand Down