Photon Server API Documentation v5.0RC1

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...
 
bool IsValid [get]
 
- 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...
 
bool IsValid [get]
 Returns whether counter is valid or not For WindowsPerfCounters this method may return value whether counter exists or not More...
 

Detailed Description

A read only ICounter that wraps a windows PerformanceCounter.

Constructor & Destructor Documentation

◆ PerformanceCounterReader() [1/2]

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.

◆ PerformanceCounterReader() [2/2]

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

◆ Decrement()

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.

◆ Dispose()

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

Releases all resources used by this instance.

◆ GetNextValue()

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.

◆ Increment()

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.

◆ IncrementBy()

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.

◆ Initialize()

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.

◆ TryGetValue()

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

◆ CategoryExists

bool ExitGames.Diagnostics.Counter.PerformanceCounterReader.CategoryExists
get

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

◆ CategoryName

string ExitGames.Diagnostics.Counter.PerformanceCounterReader.CategoryName
get

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

◆ CounterExists

bool ExitGames.Diagnostics.Counter.PerformanceCounterReader.CounterExists
get

Gets a value indicating whether the given performance counter exists.

◆ CounterType

CounterType ExitGames.Diagnostics.Counter.PerformanceCounterReader.CounterType
get

Gets the counter type of the associated performance counter.

◆ InstanceExists

bool ExitGames.Diagnostics.Counter.PerformanceCounterReader.InstanceExists
get

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

◆ InstanceName

string ExitGames.Diagnostics.Counter.PerformanceCounterReader.InstanceName
get

Gets the instance name for the performance counter.

◆ IsSingleInstance

bool ExitGames.Diagnostics.Counter.PerformanceCounterReader.IsSingleInstance
get

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

◆ IsValid

bool ExitGames.Diagnostics.Counter.PerformanceCounterReader.IsValid
get

◆ Name

string ExitGames.Diagnostics.Counter.PerformanceCounterReader.Name
get

Gets the name of the counter.