C# Class GSF.Diagnostics.PerformanceMonitor

Represents a process performance monitor that operates similar to the Windows Performance Monitor utility that can be used to monitor system performance.
Inheritance: IDisposable, IProvideStatus
Mostrar archivo Open project: GridProtectionAlliance/gsf

Public Methods

Method Description
AddCounter ( PerformanceCounter counter ) : void

Adds a PerformanceCounter to be monitored.

AddCounter ( string categoryName, string counterName, string instanceName ) : void

Adds a PerformanceCounter to be monitored.

AddCounter ( string categoryName, string counterName, string instanceName, string aliasName ) : void

Adds a PerformanceCounter to be monitored.

AddCounter ( string categoryName, string counterName, string instanceName, string aliasName, string valueUnit ) : void

Adds a PerformanceCounter to be monitored.

AddCounter ( string categoryName, string counterName, string instanceName, string aliasName, string valueUnit, float valueDivisor, bool readOnly = true ) : void

Adds a PerformanceCounter to be monitored.

Dispose ( ) : void

Releases all the resources used by the PerformanceMonitor object.

FindCounter ( string counterName ) : PerformanceCounter

Returns a PerformanceCounter object matching the specified counter name.

First PerformanceCounter with matching name is returned. If same name exists within multiple monitored categories, use FindCounter(string,string) overload instead.

FindCounter ( string categoryName, string counterName ) : PerformanceCounter

Returns a PerformanceCounter object matching the specified counter name.

FindCounters ( string counterName ) : PerformanceCounter[]

Returns PerformanceCounter array matching the specified counter name.

FindCounters ( string categoryName, string counterName ) : PerformanceCounter[]

Returns PerformanceCounter array matching the specified counter name.

PerformanceMonitor ( ) : System

Initializes a new instance of the PerformanceMonitor class.

PerformanceMonitor ( double samplingInterval, bool addDefaultCounters = true ) : System

Initializes a new instance of the PerformanceMonitor class.

PerformanceMonitor ( string processName, bool addDefaultCounters = true ) : System

Initializes a new instance of the PerformanceMonitor class.

PerformanceMonitor ( string processName, double samplingInterval, bool addDefaultCounters = true ) : System

Initializes a new instance of the PerformanceMonitor class.

RemoveCounter ( PerformanceCounter counter ) : void

Removes a PerformanceCounter being monitored.

SampleCounters ( ) : void

Sample all defined counters.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the PerformanceMonitor object and optionally releases the managed resources.

Private Methods

Method Description
m_samplingTimer_Elapsed ( object sender, ElapsedEventArgs e ) : void

Method Details

AddCounter() public method

Adds a PerformanceCounter to be monitored.
public AddCounter ( PerformanceCounter counter ) : void
counter PerformanceCounter The object to be monitored.
return void

AddCounter() public method

Adds a PerformanceCounter to be monitored.
public AddCounter ( string categoryName, string counterName, string instanceName ) : void
categoryName string The name of the performance counter category (performance object) with which this performance counter is associated.
counterName string The name of the performance counter.
instanceName string The name of the performance counter category instance, or an empty string (""), if the category contains a single instance.
return void

AddCounter() public method

Adds a PerformanceCounter to be monitored.
public AddCounter ( string categoryName, string counterName, string instanceName, string aliasName ) : void
categoryName string The name of the performance counter category (performance object) with which this performance counter is associated.
counterName string The name of the performance counter.
instanceName string The name of the performance counter category instance, or an empty string (""), if the category contains a single instance.
aliasName string The alias name for the object.
return void

AddCounter() public method

Adds a PerformanceCounter to be monitored.
public AddCounter ( string categoryName, string counterName, string instanceName, string aliasName, string valueUnit ) : void
categoryName string The name of the performance counter category (performance object) with which this performance counter is associated.
counterName string The name of the performance counter.
instanceName string The name of the performance counter category instance, or an empty string (""), if the category contains a single instance.
aliasName string The alias name for the object.
valueUnit string The measurement unit for the statistical values of the object.
return void

AddCounter() public method

Adds a PerformanceCounter to be monitored.
public AddCounter ( string categoryName, string counterName, string instanceName, string aliasName, string valueUnit, float valueDivisor, bool readOnly = true ) : void
categoryName string The name of the performance counter category (performance object) with which this performance counter is associated.
counterName string The name of the performance counter.
instanceName string The name of the performance counter category instance, or an empty string (""), if the category contains a single instance.
aliasName string The alias name for the object.
valueUnit string The measurement unit for the statistical values of the object.
valueDivisor float The divisor to be applied to the statistical values of the object.
readOnly bool Flag that determines if this counter is read-only.
return void

Dispose() public method

Releases all the resources used by the PerformanceMonitor object.
public Dispose ( ) : void
return void

Dispose() protected method

Releases the unmanaged resources used by the PerformanceMonitor object and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

FindCounter() public method

Returns a PerformanceCounter object matching the specified counter name.
First PerformanceCounter with matching name is returned. If same name exists within multiple monitored categories, use FindCounter(string,string) overload instead.
public FindCounter ( string counterName ) : PerformanceCounter
counterName string Name of the to be retrieved.
return PerformanceCounter

FindCounter() public method

Returns a PerformanceCounter object matching the specified counter name.
public FindCounter ( string categoryName, string counterName ) : PerformanceCounter
categoryName string Category of the to be retrieved.
counterName string Name of the to be retrieved.
return PerformanceCounter

FindCounters() public method

Returns PerformanceCounter array matching the specified counter name.
public FindCounters ( string counterName ) : PerformanceCounter[]
counterName string Name of the to be retrieved.
return PerformanceCounter[]

FindCounters() public method

Returns PerformanceCounter array matching the specified counter name.
public FindCounters ( string categoryName, string counterName ) : PerformanceCounter[]
categoryName string Category of the to be retrieved.
counterName string Name of the to be retrieved.
return PerformanceCounter[]

PerformanceMonitor() public method

Initializes a new instance of the PerformanceMonitor class.
public PerformanceMonitor ( ) : System
return System

PerformanceMonitor() public method

Initializes a new instance of the PerformanceMonitor class.
public PerformanceMonitor ( double samplingInterval, bool addDefaultCounters = true ) : System
samplingInterval double Interval, in milliseconds, at which the are to be sampled.
addDefaultCounters bool Set to true to add default counters; otherwise false.
return System

PerformanceMonitor() public method

Initializes a new instance of the PerformanceMonitor class.
public PerformanceMonitor ( string processName, bool addDefaultCounters = true ) : System
processName string Name of the whose performance is to be monitored.
addDefaultCounters bool Set to true to add default counters; otherwise false.
return System

PerformanceMonitor() public method

Initializes a new instance of the PerformanceMonitor class.
public PerformanceMonitor ( string processName, double samplingInterval, bool addDefaultCounters = true ) : System
processName string Name of the whose performance is to be monitored.
samplingInterval double Interval, in milliseconds, at which the are to be sampled.
addDefaultCounters bool Set to true to add default counters; otherwise false.
return System

RemoveCounter() public method

Removes a PerformanceCounter being monitored.
public RemoveCounter ( PerformanceCounter counter ) : void
counter PerformanceCounter The object to be unmonitored.
return void

SampleCounters() public method

Sample all defined counters.
public SampleCounters ( ) : void
return void