Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Monitor Your Applications With Vista's Performance Logs and Alerts : Page 2

Instrument real-time and logged performance monitoring in your applications with the new Performance Logs and Alerts API.


advertisement
Creating a Data Collector Set with the RPM
To monitor a system's reliability and performance you'll need to collect data. The possible data sources fall into three general categories:

  • Performance counters in operating system code and application code
  • Trace messages generated by various events
  • Registry key values representing system configuration information
A data collector is a specific data source in one of these categories. A data collector set is a reusable group of data collectors.

 
Figure 2. Four "System" Data Collector Sets: Windows Vista ships with four data collector sets. Selecting a data collector from the list in the left pane displays the data collectors contained by that set in the right pane.
Consider a data collector set with two performance counter data collectors, a trace message data collector, and a registry key value data collector. You can run the data collector set to collect real-time reliability and performance data and then revisit that data later. Data collector sets are hierarchical; you can organize data collector sets into other data collector sets.

Explore the data collector sets that come with Windows Vista by launching the Reliability and Performance Monitor (simply type "reliability" in the Windows Vista Start Search text box). Expand the Data Collector Sets --> System node, and then click one of the four provided data collector sets to see its data collectors (see Figure 2).

The most robust way to create a data collector set is to use an XML template that contains information about the data collector set and its individual collectors. Windows Vista ships with predefined templates you can select in the RPM Data Collector Set wizard or load using the PLA API.

To create a user-defined data collection set in the RPM, right-click on Data Collector Sets --> User Defined and then click New --> Data Collector Set.

In this case, create a template-based data collector set with a name that indicates you created it in the RPM (see Figure 3).

 
Figure 3. Creating a Data Collector Set: Create your first data collector set using one of the predefined templates that ship with Windows Vista.
 
Figure 4. Select a Template: Select a template data collector set to see a brief description of the data it collects.
 
Figure 5. Provide a Location: Specify a folder in which to store the collected data.
When you click Next, you'll get a chance to select a template. Select the System Performance template (see Figure 4).

Next, you'll need to select or enter the location where you want to store the data. This is an important consideration when you create the data collector sets programmatically through the PLA API—you'll want to be able to get to the data later. For this example, you can accept the default (see Figure 5).

When you click Next from the screen in Figure 5, you'll get a screen where you can select an account under which to run the collector set, and some options that determine what the wizard does when it finishes. For this exercise, accept the <Default> account, select the option to "Open the properties for this data collector set," and click Finish (see Figure 6). That closes the wizard and brings up the data collector set Properties dialog shown in Figure 7.

 
Figure 6. Create Options: The last screen of the Wizard lets you choose an account and provides three post-Wizard options for the new data collector set.
 
Figure 7. Setting Data Collector Set Properties: Data collector set properties include all the parameters shown here, plus additional settings for security and scheduling.
Change the description as shown in Figure 7, and then close the dialog.

Now you can expand the Data Collector Sets --> User Defined node in RPM to see your new data collector set. Right-click on the new data collector set item, and then click Save Template to export it as an XML file. You can make a few changes to the XML file and use it to create another data collector set with the PLA API. Here are a few portions of the template you just created:

<?xml version="1.0" encoding="UTF-16"?> <DataCollectorSet> ... <Description>A sample data collector set...</Description> ... <Name>DevX (Created with the PLA API)</Name> <OutputLocation> C:\perflogs\DevX (Created with the PLA API)\20070501-0001 </OutputLocation> ... <UserAccount>SYSTEM</UserAccount> ... <TraceDataCollector> <DataCollectorType>1</DataCollectorType> <Name>NT Kernel</Name> ... </TraceDataCollector> <PerformanceCounterDataCollector> <DataCollectorType>0</DataCollectorType> <Name>Performance Counter</Name> ... </PerformanceCounterDataCollector> <DataManager> ... </DataManager> <Value name="PerformanceMonitorView" type="document"> ... </Value> </DataCollectorSet>

Data collector set templates may contain an enormous amount of information and are difficult to author from scratch, so it's easiest to use the RPM to create data collector set templates for use in your PLA-enabled applications.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap