#include <OW32/OW32libs.h>
#include <OW32/windows.h>
#include <winperf.h>
#include <string>
#include <map>
#include <OW32/tstl.h>
#include <OW32/XHANDLE.h>
#include <OW32/SyncObjects.h>
Go to the source code of this file.
Namespaces | |
namespace | OW32 |
Classes | |
class | OW32::CPerfDataException |
The general exception thrown by CPerfData and friends. More... | |
class | OW32::CPerfData |
Performance data helper. More... | |
class | OW32::CPerfObject |
Represents a performance object. More... | |
class | OW32::CPerfCounter |
A performance counter definition. More... | |
Defines | |
#define | PERF_DECLARE_MAP(appName) extern OW32::CPerfData g_perfData_##appName; |
Declares a performance map. | |
#define | PERF_DEFINE_OBJECT(sym, val) const OW32::CPerfData::ObjectId sym = (OW32::CPerfData::ObjectId)val; |
Defines a performance object. | |
#define | PERF_DEFINE_COUNTER(sym, val) const OW32::CPerfData::CounterId sym = (OW32::CPerfData::CounterId)val; |
Defines a performance counter. | |
#define | PERF_MAP_BEGIN(appName) |
Defines a performance counter map for the application. | |
#define | PERF_MAP_BEGIN_OBJECT(objectId, name, help, detailLevel, defaultCounterId, maxInstances, maxInstanceName) |
Defines a performance object. | |
#define | PERF_MAP_COUNTER(counterId, name, help, detailLevel, defaultScale, type) |
Defines a performance counter. | |
#define | PERF_MAP_COUNTER_SHARED(counterId, counterIdData, name, help, detailLevel, defaultScale, type) |
Defines a performance counter that shares data with another. | |
#define | PERF_MAP_END_OBJECT() } \ |
Ends a performance object definition. | |
#define | PERF_MAP_END(appName) |
Ends a performance object map. | |
#define | PERF_IMPLEMENT_COLLECTOR(appName) |
Implement the performance data collection entry points. | |
#define | PERF_IMPLEMENT_COLLECTOR_REGISTRATION(appName) |
Implements the entry points DllRegisterServer and DllUnregisterServer. | |
Variables | |
OW32_LIB_EXPORT | CPerfObject |
OW32_LIB_EXPORT | CPerfCounter |
|
Declares a performance map.
|
|
Defines a performance counter.
|
|
Defines a performance object.
|
|
Implement the performance data collection entry points. You should use this in your performance data collection DLL. You must also include the following in the module definition file: EXPORTS OW32_PerfData_appName_Open OW32_PerfData_appName_Close OW32_PerfData_appName_Collect It is not sensible to attempt to do this with __declspec(dllexport) as this decorates the names rather randomly between compiler versions. You may call this more than once to implement entry points for different application names within a single DLL if desired. Note that collector registration must be implemented manually in that case. |
|
Implements the entry points DllRegisterServer and DllUnregisterServer. This allows the required performance counter information to be inserted/removed from the registry by using regsvr32 (/u) on the performance data collector DLL. This also provides a DllMain that stores the modules instance handle so that the path to the DLL can later be retrieved. You must also include the following in the module definition file: EXPORTS DllRegisterServer PRIVATE DllUnregisterServer PRIVATE |
|
Value: OW32::CPerfData g_perfData_##appName(L#appName); \ class CPerfMapConstructor \ { \ public: \ CPerfMapConstructor(OW32::CPerfData *perfData); \ }; \ \ CPerfMapConstructor::CPerfMapConstructor(OW32::CPerfData *perfData) \ { There may be multiple performance counter maps if desired, with multiple performance data collection functions. This is not terribly useful in general, but is allowed...
|
|
Value: { \ static OW32::CPerfObject currentObject( \ perfData, objectId, L##name, L##help, detailLevel, defaultCounterId, \ static_cast<DWORD>(maxInstances), maxInstanceName); Must appear after PERF_MAP_BEGIN.
|
|
Value: { \ static OW32::CPerfCounter currentCounter( \ ¤tObject, counterId, L##name, L##help, detailLevel, \ static_cast<DWORD>(defaultScale), type); \ } Must appear after PERF_MAP_BEGIN_OBJECT.
|
|
Value: { \ static OW32::CPerfCounter currentCounter( \ ¤tObject, counterId, L##name, L##help, detailLevel, defaultScale, type, counterIdData); \ } Must appear after PERF_MAP_BEGIN_OBJECT. This is useful when you want both a rate (PERF_COUNTER_COUNTER) and a total counter which share the same data. This macro must appear after the PERF_MAP_COUNTER entry for the parent counter.
|
|
Value: } \
static CPerfMapConstructor s_constructPerfData(&g_perfData_##appName);
Must appear after PERF_MAP_BEGIN.
|
|
Ends a performance object definition. Must appear after PERF_MAP_BEGIN_OBJECT. |