Photon Server API
Public Member Functions | Properties | List of all members
ExitGames.Diagnostics.Counter.PerformanceCounterReader Class Reference

A read only ICounter that wraps a windows PerformanceCounter. More...

Inheritance diagram for ExitGames.Diagnostics.Counter.PerformanceCounterReader:
ExitGames.Diagnostics.Counter.ICounter Photon.Common.LoadBalancer.LoadShedding.AverageCounterReader

Public Member Functions

 PerformanceCounterReader (string categoryName, string counterName)
 Initializes a new instance of the PerformanceCounterReader class. More...
 
 PerformanceCounterReader (string categoryName, string counterName, string instanceName)
 Initializes a new instance of the PerformanceCounterReader class. More...
 
void Initialize ()
 Initalizes this instance. There is usally no need to call this method since the constructor has already taken care of it. More...
 
bool TryGetValue (out float value)
 Tries to obtain a counter sample and returns the calculated value for it. More...
 
long Decrement ()
 Not supported by this readonly ICounter implementation. More...
 
float GetNextValue ()
 Obtains a counter sample and returns the calculated value for it. More...
 
long Increment ()
 Not supported by this readonly ICounter implementation. More...
 
long IncrementBy (long value)
 Not supported by this readonly ICounter implementation. More...
 
void Dispose ()
 Releases all resources used by this instance. More...
 

Properties

bool CategoryExists [get]
 Gets a value indicating whether the given performance counter category exists. More...
 
string CategoryName [get]
 Gets the name of the performance counter category for the performance counter. More...
 
bool CounterExists [get]
 Gets a value indicating whether the given performance counter exists. More...
 
CounterType CounterType [get]
 Gets the counter type of the associated performance counter. More...
 
bool InstanceExists [get]
 Gets a value indicating whether the given performance counter instance exists. More...
 
string InstanceName [get]
 Gets the instance name for the performance counter. More...
 
bool IsSingleInstance [get]
 Gets a value indicating whether the performance counter category can have only a single instance. More...
 
string Name [get]
 Gets the name of the counter. More...
 
- Properties inherited from ExitGames.Diagnostics.Counter.ICounter
CounterType CounterType [get]
 Gets the type of the counter. More...
 
string Name [get]
 Gets the name of the counter. More...
 

Detailed Description

A read only ICounter that wraps a windows PerformanceCounter.

Constructor & Destructor Documentation

ExitGames.Diagnostics.Counter.PerformanceCounterReader.PerformanceCounterReader ( string  categoryName,
string  counterName 
)
inline

Initializes a new instance of the PerformanceCounterReader class.

Parameters
categoryNameThe name of the performance counter category.
counterNameThe performance counter name counter.
ExitGames.Diagnostics.Counter.PerformanceCounterReader.PerformanceCounterReader ( string  categoryName,
string  counterName,
string  instanceName 
)
inline

Initializes a new instance of the PerformanceCounterReader class.

Parameters
categoryNameThe name of the performance counter category.
counterNameThe performance counter name counter.
instanceNameThe instance name for the performance counter.

Member Function Documentation

long ExitGames.Diagnostics.Counter.PerformanceCounterReader.Decrement ( )
inline

Not supported by this readonly ICounter implementation.

Returns
Throws a NotSupportedException.
Exceptions
NotSupportedExceptionThis counter is read only.

Implements ExitGames.Diagnostics.Counter.ICounter.

void ExitGames.Diagnostics.Counter.PerformanceCounterReader.Dispose ( )
inline

Releases all resources used by this instance.

float ExitGames.Diagnostics.Counter.PerformanceCounterReader.GetNextValue ( )
inline

Obtains a counter sample and returns the calculated value for it.

Returns
The next calculated value that the system obtains for this counter.

Implements ExitGames.Diagnostics.Counter.ICounter.

long ExitGames.Diagnostics.Counter.PerformanceCounterReader.Increment ( )
inline

Not supported by this readonly ICounter implementation.

Returns
Throws a NotSupportedException.
Exceptions
NotSupportedExceptionThis counter is read only.

Implements ExitGames.Diagnostics.Counter.ICounter.

long ExitGames.Diagnostics.Counter.PerformanceCounterReader.IncrementBy ( long  value)
inline

Not supported by this readonly ICounter implementation.

Parameters
valueThe value.
Returns
Throws a NotSupportedException.
Exceptions
NotSupportedExceptionThis counter is read only.

Implements ExitGames.Diagnostics.Counter.ICounter.

void ExitGames.Diagnostics.Counter.PerformanceCounterReader.Initialize ( )
inline

Initalizes this instance. There is usally no need to call this method since the constructor has already taken care of it.

bool ExitGames.Diagnostics.Counter.PerformanceCounterReader.TryGetValue ( out float  value)
inline

Tries to obtain a counter sample and returns the calculated value for it.

Parameters
valueWhen this method returns, contains the calculated value for the performance counter if the the performance counter exists; otherwise, the default value for the type of the value parameter is returned.
Returns
True if performcae counter exists and the calcualted value could be obtained; otherwise, false.

Property Documentation

bool ExitGames.Diagnostics.Counter.PerformanceCounterReader.CategoryExists
get

Gets a value indicating whether the given performance counter category exists.

string ExitGames.Diagnostics.Counter.PerformanceCounterReader.CategoryName
get

Gets the name of the performance counter category for the performance counter.

bool ExitGames.Diagnostics.Counter.PerformanceCounterReader.CounterExists
get

Gets a value indicating whether the given performance counter exists.

CounterType ExitGames.Diagnostics.Counter.PerformanceCounterReader.CounterType
get

Gets the counter type of the associated performance counter.

bool ExitGames.Diagnostics.Counter.PerformanceCounterReader.InstanceExists
get

Gets a value indicating whether the given performance counter instance exists.

string ExitGames.Diagnostics.Counter.PerformanceCounterReader.InstanceName
get

Gets the instance name for the performance counter.

bool ExitGames.Diagnostics.Counter.PerformanceCounterReader.IsSingleInstance
get

Gets a value indicating whether the performance counter category can have only a single instance.

string ExitGames.Diagnostics.Counter.PerformanceCounterReader.Name
get

Gets the name of the counter.