Saving Settings

You've picked your way through all 400-plus counters and innumerable instances, and configured your measurements with great care. Do you want to do it again tomorrow? No way!

This is what the settings files are all about. You can save what you are measuring and how you are measuring it in a settings file by choosing Save or Save As from the File menu. The first time you save your settings, you are prompted to assign a name to your settings file. The name of your settings file appears in the status bar. You use Open from the File menu to install a previously saved settings file. The name of your opened settings file appears in the status bar. You can remove all your current settings by choosing New from the File menu.

Usually, you will save your current view. The following file suffixes are, by convention, used for the settings files, but you can save and open settings files with different extensions.

Table 2.5 Settings File Suffixes

Suffix

Settings-file type

.PMC

Chart

.PMR

Report

.PMA

Alert

.PML

Log

.PMW

Workspace

|


If you choose Save Workspace from the File menu, the current settings for all four views are saved in the Workspace settings file. Opening this file restores all four views. In addition to the four views, the current screen size and position of Performance Monitor are saved in the Workspace. (Otherwise, Performance Monitor starts up in the position it held when you last quit.)

You can move settings files from one computer to another. However, if the computers have different hardware and software, the settings file might not apply fully on the new machine. For example, if the original machine has one disk partition, and the new one has two, the second disk partition is not in the settings file. If you want it to be, simply add the second partition to the measurement and choose Save from the File menu to save the settings file.

What if you now move the settings file back to the first machine? The second partition will not be found, but it will still appear in the measurement. Because no such object or instance could be found, the counters will all drop to zero just as though it were a deceased mortal instance. The nonexistent object will remain in the measurement and in the settings file even if the settings file is saved again on the first computer. Thus you can build up settings files from multiple computers with ghosts of mortal and even immortal instances, and share them around with your friends. It's like sharing a little bit of heaven. Sort of.

You can specify a settings file on the command line of Performance Monitor by typing:

perfmon settings-file-name

Performance Monitor starts up with that settings file loaded. The appropriate view or views start data collection as specified in the settings file.

If you specify a workspace on the command line, Performance Monitor loads the settings for all four views.

If there is no settings file specified on the command line, Performance Monitor searches its working directory for the file _default.pmc. If found, it loads this settings file and it becomes the current view.

Tip Here's a trick you can use: although the .PMC suffix is used, this file could actually be from any view or even a workspace. This is one reason why we do not enforce the suffixes: there are times like this when you want to fake them out.

You can modify computer and instance names in a chart settings file using the setedit.exe utility on the diskette or CD-ROM included with this book. The setedit utility displays the settings file entries in the chart legend. You select the legend line you want to change and double-click, or select Edit Chart Line from the Edit menu.

If you have a settings file that you can see in File Manager, you can drag it to a running copy of Performance Monitor and it will start running. This clears out the current settings file in that view (or in all four views for a workspace), so be sure to save your current settings if necessary.

Here is another neat thing you should try once you have a few settings files created. Start File Manager from Program Manager's Main group, and then select the Associate command from the File menu. Press the New Type button. In the File Type box, type Performance Monitor Charts. In the Command box, type perfmon.exe. In the New Extension box, type PMC, and then press the Add button, and the OK button. Do the same for alerts, reports, logs, and workspaces, using appropriate file types and extensions. Once this is done, you can double-click a settings file in File Manager, and Performance Monitor starts, executing that settings file.

Now some more legerdemain: go back to Program Manager and create a new program group called PerfMagic using the New menu command on the File menu. (It can be either a personal or common program group. If you want other people to be able to use it, it must be a common program group. You must be an administrator on your computer to create a common program group.) Now restore File Manager and Program Manager so that you can see your settings files in File Manager, and your new PerfMagic Group in Program Manager. Now you can drag your settings files to the PerfMagic Group from File Manager. They are Performance Monitor icons and you can double-click them to execute them. Now that's cool!