The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CHeapMemoryPerformanceMonitorCounters Class Reference

Inheritance diagram for CHeapMemoryPerformanceMonitorCounters:
Collaboration diagram for CHeapMemoryPerformanceMonitorCounters:

List of all members.


Detailed Description

An object which represents an installed set of performance counters in memory in an application that wishes to export those counters. This object is created from a CPerformanceDataSchema and provides methods for an application which exports counters to create and manipulate a set of counters. These counters can then be consumed by an instance of CPerformanceDataCollector which has been created with the same schema. The object supports the JetByteTools::Win32::ICriticalSection interface so that you can lock the entire set of counters if you need to during updates to ensure that updates are atomic, however, this is very rarely required. Each individual counter update can be guaranteed to be atomic without the need for external locking.


Public Types

typedef LONG InstanceId
 An instance id.

Public Member Functions

 CHeapMemoryPerformanceMonitorCounters (const CPerformanceDataSchema &schema)
 Creates a set of performance counters within a process using normal memory so that the process can expose them using a custom API. The counters are defined by the supplied schema.
 CHeapMemoryPerformanceMonitorCounters (const CHeapMemoryPerformanceMonitorCounters &rhs)
virtual ~CHeapMemoryPerformanceMonitorCounters () override
 Cleans up and removes any object instance names that were registered by this object.
CHeapMemoryPerformanceMonitorCountersoperator= (const CHeapMemoryPerformanceMonitorCounters &rhs)
JetByteTools::Core::ILockableObjectGetLock ()
IPerformanceDataBlockGetDataBlock ()
ObjectId GetPerformanceObject (const JetByteTools::Core::_tstring &objectName) const
 Returns the object id of the specified performance object. Note that the object must have been defined in the schema used to construct this object. The name is the object's name in the schema's default language.
DWORD GetMaxInstanceNameLength (const JetByteTools::Core::_tstring &objectName) const
 Returns the maximum allowable instance name length for an object of the specified name. Note that the object must have been defined as an object with instances allocated by name in the schema used to construct this object. The name is the object's name in the schema's default language.
DWORD GetNumberOfInstancesAllocated (const JetByteTools::Core::_tstring &objectName) const
 Returns the number of instances currently allocated of objects of the specified name.
ObjectId AllocatePerformanceObjectInstance (const JetByteTools::Core::_tstring &objectName, const JetByteTools::Core::_tstring &instanceName, bool alwaysResetCounters=false)
 Returns the object id of the specific instance of the specific performance object. If the instance already exists then the counters for this instance are reset to zero. Note that the object must have been defined as an object with instances allocated by name in the schema used to construct this object. The name is the object's name in the schema's default language.
ObjectId AllocatePerformanceObjectInstance (const JetByteTools::Core::_tstring &objectName, const InstanceId &instanceId, bool alwaysResetCounters=false)
 Returns the object id of the specific instance of the specific performance object. If the instance already exists then the counters for this instance are reset to zero. Note that the object must have been defined as an object with instances allocated by instance id in the schema used to construct this object. The name is the object's name in the schema's default language.
ObjectId AllocateChildPerformanceObjectInstance (const JetByteTools::Core::_tstring &objectName, const JetByteTools::Core::_tstring &instanceName, const ObjectId &parentObjectId, bool alwaysResetCounters=false)
 Returns the object id of the specific instance of the specific performance object with the specific parent. If the instance already exists then the counters for this instance are reset to zero. Note that the object must have been defined as an object with instances allocated by name in the schema used to construct this object. The name is the object's name in the schema's default language.
void ResetPerformanceObjectInstance (const ObjectId &objectId)
 Returns the object id of the specific instance of the specific performance object with the specific parent. Looks at the parent's object name and extracts the instance, if any, and creates the child object instance in the same object instance as the parent... If the instance already exists then the counters for this instance are reset to zero. Note that the object must have been defined as an object with instances allocated by name in the schema used to construct this object. The name is the object's name in the schema's default language.
void ReleasePerformanceObjectInstance (const ObjectId &objectId)
 Releases a performance object. If this is an object with instances then the instance is now available for reuse.
CounterId GetPerformanceCounter (const ObjectId &objectId, const JetByteTools::Core::_tstring &counterName) const
 Returns the counter id of the specific counter. Note that the counter must have been defined in the schema used to construct this object. The name is the counter's name in the schema's default language.
bool GetInstanceNamesForObject (const JetByteTools::Core::_tstring &objectName, JetByteTools::Core::StringVector &instanceNames) const
LONGAccessPerformanceCounter32 (const CounterId &counter)
 Returns a writable 32-bit value for the specific counter id.
void SetPerformanceCounter32 (const CounterId &counter, LONG value)
 Sets the specified counter to the supplied value.
__int64 & AccessPerformanceCounter64 (const CounterId &counter)
 Returns a writable 64-bit value for the specific counter id.
void SetPerformanceCounter64 (const CounterId &counter, __int64 value)
 Sets the specified counter to the supplied value.
LONG IncrementPerformanceCounter32 (const CounterId &counter)
 Increments the specified 32-bit counter and returns the incremented value.
LONG DecrementPerformanceCounter32 (const CounterId &counter)
 Decrements the specified 32-bit counter and returns the decremented value.
__int64 IncrementPerformanceCounter64 (const CounterId &counter)
 Increments the specified 64-bit counter and returns the incremented value. Uses InterlockedIncrement64() to do this.
__int64 DecrementPerformanceCounter64 (const CounterId &counter)
 Decrements the specified 64-bit counter and returns the decremented value. Uses InterlockedIncrement64() to do this.
LONG AddToPerformanceCounter32 (const CounterId &counter, LONG value)
 Adds the supplied value to the specified 32-bit counter and returns the result.
LONG SubtractFromPerformanceCounter32 (const CounterId &counter, LONG value)
 Subtracts the supplied value from the specified 32-bit counter and returns the result.
__int64 AddToPerformanceCounter64 (const CounterId &counter, __int64 value)
 Adds the supplied value to the specified 64-bit counter and returns the result. Uses InterlockedIncrement64() to do this.
__int64 SubtractFromPerformanceCounter64 (const CounterId &counter, __int64 value)
 Subtracts the supplied value from the specified 32-bit counter and returns the result. Uses InterlockedIncrement64() to do this.

Static Public Attributes

static const ObjectId NoObject
 A performance object id.
static const CounterId NoCounter
 A performance counter id.

Protected Member Functions

void Initialise (IPerformanceDataBlock &dataBlock, const CPerformanceDataSchema &schema)


Member Typedef Documentation

typedef LONG InstanceId [inherited]

An instance id.


Constructor & Destructor Documentation

Creates a set of performance counters within a process using normal memory so that the process can expose them using a custom API. The counters are defined by the supplied schema.

virtual ~CHeapMemoryPerformanceMonitorCounters (  )  [override, virtual]

Cleans up and removes any object instance names that were registered by this object.


Member Function Documentation

ILockableObject & GetLock (  )  [inherited]

IPerformanceDataBlock & GetDataBlock (  )  [inherited]

ObjectId GetPerformanceObject ( const JetByteTools::Core::_tstring objectName  )  const [inherited]

Returns the object id of the specified performance object. Note that the object must have been defined in the schema used to construct this object. The name is the object's name in the schema's default language.

DWORD GetMaxInstanceNameLength ( const JetByteTools::Core::_tstring objectName  )  const [inherited]

Returns the maximum allowable instance name length for an object of the specified name. Note that the object must have been defined as an object with instances allocated by name in the schema used to construct this object. The name is the object's name in the schema's default language.

DWORD GetNumberOfInstancesAllocated ( const JetByteTools::Core::_tstring objectName  )  const [inherited]

Returns the number of instances currently allocated of objects of the specified name.

ObjectId AllocatePerformanceObjectInstance ( const JetByteTools::Core::_tstring objectName,
const JetByteTools::Core::_tstring instanceName,
bool  alwaysResetCounters = false 
) [inherited]

Returns the object id of the specific instance of the specific performance object. If the instance already exists then the counters for this instance are reset to zero. Note that the object must have been defined as an object with instances allocated by name in the schema used to construct this object. The name is the object's name in the schema's default language.

ObjectId AllocatePerformanceObjectInstance ( const JetByteTools::Core::_tstring objectName,
const InstanceId instanceId,
bool  alwaysResetCounters = false 
) [inherited]

Returns the object id of the specific instance of the specific performance object. If the instance already exists then the counters for this instance are reset to zero. Note that the object must have been defined as an object with instances allocated by instance id in the schema used to construct this object. The name is the object's name in the schema's default language.

ObjectId AllocateChildPerformanceObjectInstance ( const JetByteTools::Core::_tstring objectName,
const JetByteTools::Core::_tstring instanceName,
const ObjectId &  parentObjectId,
bool  alwaysResetCounters = false 
) [inherited]

Returns the object id of the specific instance of the specific performance object with the specific parent. If the instance already exists then the counters for this instance are reset to zero. Note that the object must have been defined as an object with instances allocated by name in the schema used to construct this object. The name is the object's name in the schema's default language.

void ResetPerformanceObjectInstance ( const ObjectId &  objectId  )  [inherited]

Returns the object id of the specific instance of the specific performance object with the specific parent. Looks at the parent's object name and extracts the instance, if any, and creates the child object instance in the same object instance as the parent... If the instance already exists then the counters for this instance are reset to zero. Note that the object must have been defined as an object with instances allocated by name in the schema used to construct this object. The name is the object's name in the schema's default language.

Resets a performance object. All counters are set to zero.

void ReleasePerformanceObjectInstance ( const ObjectId &  objectId  )  [inherited]

Releases a performance object. If this is an object with instances then the instance is now available for reuse.

CounterId GetPerformanceCounter ( const ObjectId &  objectId,
const JetByteTools::Core::_tstring counterName 
) const [inherited]

Returns the counter id of the specific counter. Note that the counter must have been defined in the schema used to construct this object. The name is the counter's name in the schema's default language.

bool GetInstanceNamesForObject ( const JetByteTools::Core::_tstring objectName,
JetByteTools::Core::StringVector instanceNames 
) const [inherited]

LONG & AccessPerformanceCounter32 ( const CounterId &  counter  )  [inherited]

Returns a writable 32-bit value for the specific counter id.

void SetPerformanceCounter32 ( const CounterId &  counter,
LONG  value 
) [inherited]

Sets the specified counter to the supplied value.

__int64 & AccessPerformanceCounter64 ( const CounterId &  counter  )  [inherited]

Returns a writable 64-bit value for the specific counter id.

void SetPerformanceCounter64 ( const CounterId &  counter,
__int64  value 
) [inherited]

Sets the specified counter to the supplied value.

LONG IncrementPerformanceCounter32 ( const CounterId &  counter  )  [inherited]

Increments the specified 32-bit counter and returns the incremented value.

LONG DecrementPerformanceCounter32 ( const CounterId &  counter  )  [inherited]

Decrements the specified 32-bit counter and returns the decremented value.

__int64 IncrementPerformanceCounter64 ( const CounterId &  counter  )  [inherited]

Increments the specified 64-bit counter and returns the incremented value. Uses InterlockedIncrement64() to do this.

__int64 DecrementPerformanceCounter64 ( const CounterId &  counter  )  [inherited]

Decrements the specified 64-bit counter and returns the decremented value. Uses InterlockedIncrement64() to do this.

LONG AddToPerformanceCounter32 ( const CounterId &  counter,
LONG  value 
) [inherited]

Adds the supplied value to the specified 32-bit counter and returns the result.

LONG SubtractFromPerformanceCounter32 ( const CounterId &  counter,
LONG  value 
) [inherited]

Subtracts the supplied value from the specified 32-bit counter and returns the result.

__int64 AddToPerformanceCounter64 ( const CounterId &  counter,
__int64  value 
) [inherited]

Adds the supplied value to the specified 64-bit counter and returns the result. Uses InterlockedIncrement64() to do this.

__int64 SubtractFromPerformanceCounter64 ( const CounterId &  counter,
__int64  value 
) [inherited]

Subtracts the supplied value from the specified 32-bit counter and returns the result. Uses InterlockedIncrement64() to do this.

void Initialise ( IPerformanceDataBlock dataBlock,
const CPerformanceDataSchema schema 
) [protected, inherited]


Member Data Documentation

const CPerformanceMonitorCountersBase::ObjectId NoObject [static, inherited]

A performance object id.

const CPerformanceMonitorCountersBase::CounterId NoCounter [static, inherited]

A performance counter id.


Generated on Sun Sep 12 19:09:50 2021 for The Server Framework - v7.4 by doxygen 1.5.3