Using PerformanceDataSet
[Using instructions]

Class PerformanceDataSet allows easy access to performance counter values. More...

Collaboration diagram for Using PerformanceDataSet:


Detailed Description

Class PerformanceDataSet allows easy access to performance counter values.


This file was originally retrieved from MSDN (q194655) as rkLeak.h/cpp and adjusted for test purposes.

The code assumes the existence of PDH.DLL on the system. If not available define NO_PDH_DLL to suppress this part of code.

Usage:

.// Define counters to check
.// (assuming Windows XP with German language pack, and a computer named SIRIUS)
 std::vector<std::string> counterNames;
 counterNames.push_back("\\\\SIRIUS\\Prozessor(0)\\Prozessorzeit (%)");
 counterNames.push_back("\\\\SIRIUS\\Prozess(notepad)\\Threadanzahl");
 counterNames.push_back("\\\\SIRIUS\\Prozess(TestPerformanceDataSet)\\Private Bytes");
 
.// Prepare access to counter names (may fail in case of invalid names)
 TTB::PerformanceDataSet perfDataSet;
 perfDataSet.InitPerfCounters (m_counterNames);

.// Access current counter values
 std::vector<double> counterValues =perfDataSet.GetCurrentCounterValues();
See also:
PerformanceDataSet.h (File documentation)
TestToolBox::PerformanceDataSet (class documentation)
TestPerformanceDataSet (unit test for class PerformanceDataSet)
Generated on Fri May 27 22:51:40 2011 for TestToolBox by  doxygen 1.6.3