2. Performance Monitor
The Performance Monitor tool comes installed
with all versions of the Windows operating system. This tool provides a
graphical interface for accessing the performance counters introduced
in the preceding section. The easiest way to access the Performance
Monitor tool, often referred to as Perfmon because of the name of the
executable file, is to click the Start menu on your server and click
the Run icon. Type perfmon, and then click the OK button. This will open a window that looks like Figure 1.
Figure 1. Performance Monitor suite
A number of tasks are possible with the Perfmon
tool, including viewing performance monitor counters, creating logs of
counters, and scheduling the capture of counters to files that can then
be viewed through the Perfmon tool or imported into databases for more
sophisticated data manipulation. I’ll simply show how to view a few of
the counters introduced in the previous section.
You first have to access
the Performance Monitor tool. Click the icon on the left side of the
screen labeled Performance Monitor. This will display a screen similar
to Figure 2.
Figure 2. Initial Performance Monitor window
To add counters to the Performance Monitor
window, click the plus icon near the center of the toolbar at the top
of the window. This will open the Add Counters window, shown in Figure 3.
Figure 3. The Add Counters window in Perfmon
To select counters for a particular computer,
you’ll need to supply the name of the computer in the “Select counters
from computer” combo box, or you can simply let the tool select from
the local computer, as displayed in Figure 3.
To supply the name, you can either type it or select from a list of
computers on your network. Once that’s done, you’ll need to select one
of the performance objects. As shown in Figure 2,
the % Processor Time object has already been selected for you. To
select additional counters, scroll within the “Available counters”
window. Scroll down until you find the User Connections counter, and then click
it. Click the Add button to add this counter to the “Added counters”
list on the right. When you’re done adding counters, click the OK
button.
Now the Perfmon window will show activity from
the two counters selected. The window shows a set period of time, and
you can see the variations in data across the period, as shown in Figure 4.
Figure 4. Perfmon displaying performance counters and activity
Looking at the screen displayed in Figure 4,
you can see how the performance counters change over time. The data is
collected and aggregated so that you can see important information such
as the Last, Average, Maximum, and Minimum values. The duration, the
amount of time on display, is also shown. You can see the list of
counters that is currently on display. You can even highlight a counter
by selecting it in the list and then clicking the lightbulb icon in the
toolbar at the top of the screen.
With the Perfmon tool, you can further
manipulate the display to show different types of graphs or raw data
and change the properties of the counters displayed to adjust the color
they’re displayed in or the scale on which they display. You can also
choose to have the Perfmon tool output to a log. There are other ways
to get at performance counters, and one of them is within SQL Server
using T-SQL.