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
Afficher le fichier Open project: GridProtectionAlliance/gsf

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

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

Private Methods

Méthode Description
m_samplingTimer_Elapsed ( object sender, ElapsedEventArgs e ) : void

Method Details

AddCounter() public méthode

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

AddCounter() public méthode

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.
Résultat void

AddCounter() public méthode

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.
Résultat void

AddCounter() public méthode

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.
Résultat void

AddCounter() public méthode

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.
Résultat void

Dispose() public méthode

Releases all the resources used by the PerformanceMonitor object.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

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.
Résultat void

FindCounter() public méthode

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.
Résultat PerformanceCounter

FindCounter() public méthode

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.
Résultat PerformanceCounter

FindCounters() public méthode

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

FindCounters() public méthode

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.
Résultat PerformanceCounter[]

PerformanceMonitor() public méthode

Initializes a new instance of the PerformanceMonitor class.
public PerformanceMonitor ( ) : System
Résultat System

PerformanceMonitor() public méthode

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.
Résultat System

PerformanceMonitor() public méthode

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.
Résultat System

PerformanceMonitor() public méthode

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.
Résultat System

RemoveCounter() public méthode

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

SampleCounters() public méthode

Sample all defined counters.
public SampleCounters ( ) : void
Résultat void