6.20 CLRThreads

Use this Knowledge Script to monitor thread use in managed .NET applications. This script raises an event if one of the following conditions exists:

  • The total number of threads (total recognized threads) that have run at least once since the application started exceeds a specified threshold.

  • The rate at which processors are assigned to alternate threads (context switch rate) exceeds a specified threshold. For example, the kernel can reassign an operation when a thread with higher priority becomes available.

NOTE:The monitored .NET applications must be running at the time of discovery so their resource objects can discovered. The applications must also be running for this script to collect data.

6.20.1 Default Schedule

The default schedule for this script is Every 5 minutes.

6.20.2 Resource Objects

Managed Applications folder

Managed Applications object

6.20.3 Setting Parameter Values

Set the following parameters as needed:

Parameter

How to Set It

General Settings

Raise event if application not running?

Set to Yes to raise an event if the managed application is not running. The default is Yes.

Event severity when application not running

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the managed application is not running. The default is 20 (yellow event indicator).

Monitor Thread Count

Event Notification

Raise event if thread count exceeds threshold?

Set to Yes to raise an event if the number threads that have run at least once exceeds the threshold you set. The default is Yes.

Threshold - Maximum thread count

Specify the maximum number of threads that can run before an event is raised. The default is 32 threads.

Event severity when thread count exceeds threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the number of threads exceeds the threshold. The default is 15 (yellow event indicator).

Data Collection

Collect data for thread count?

Set to Yes to collect data for charts and reports. When enabled, data collection returns the number of threads that ran at least once during the monitoring interval. The default is unselected.

Monitor Context Switch Rate

Event Notification

Raise event if context switch rate exceeds threshold?

Set to Yes to raise an event if the switch rate exceeds the threshold you set. The default is Yes.

Threshold - Maximum context switch rate

Specify the maximum rate at which processors can be assigned to alternate thread before an event is raised. The default is 4096 switches per second.

Event severity when context switch rate exceeds threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the switch rate exceeds the threshold. The default is 15 (yellow event indicator).

Data Collection

Collect data for context switch rate?

Set to Yes to collect data for charts and reports. When enabled, data collection returns the context switch rate for the monitoring interval. The default is unselected.