Click or drag to resize

PerformanceMonitor Class

Represents a process performance monitor that operates similar to the Windows Performance Monitor utility that can be used to monitor system performance.
Inheritance Hierarchy
SystemObject
  GSF.DiagnosticsPerformanceMonitorBase
    GSF.DiagnosticsPerformanceMonitor

Namespace: GSF.Diagnostics
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public class PerformanceMonitor : PerformanceMonitorBase
View Source

The PerformanceMonitor type exposes the following members.

Constructors
 NameDescription
Public methodPerformanceMonitor Initializes a new instance of the PerformanceMonitor class.
Public methodPerformanceMonitor(Double, Boolean) Initializes a new instance of the PerformanceMonitor class.
Public methodPerformanceMonitor(String, Boolean) Initializes a new instance of the PerformanceMonitor class.
Public methodPerformanceMonitor(String, Double, Boolean) Initializes a new instance of the PerformanceMonitor class.
Top
Properties
 NameDescription
Public propertyCounters Gets a read-only list of the PerformanceCounter objects monitored by the PerformanceMonitor object.
(Inherited from PerformanceMonitorBase)
Public propertyCPUUsage Gets the PerformanceCounter that monitors the processor utilization of the monitored process.
Public propertyHandleCount Gets the PerformanceCounter that monitors the total number of handles currently open by the monitored process.
Public propertyIOActivity Gets the PerformanceCounter that monitors the rate at which the monitored process is issuing read and write I/O operations.
Public propertyIOUsage Gets the PerformanceCounter that monitors the rate at which the monitored process is issuing bytes to I/O operations that do not involve data such as control operations.
Public propertyIPDataReceiveRate Gets the PerformanceCounter that monitors the IP based datagrams received / second of the system.
Public propertyIPDataSendRate Gets the PerformanceCounter that monitors the IP based datagrams sent / second of the system.
Public propertyLifetimeStatus Gets the lifetime status statistics of the PerformanceMonitor object.
(Inherited from PerformanceMonitorBase)
Public propertyMemoryUsage Gets the PerformanceCounter that monitors the memory utilization of the monitored process.
Public propertyName Gets the friendly name of the PerformanceMonitor object.
(Overrides PerformanceMonitorBaseName)
Public propertyProcessName Gets or sets the name of the Process to be monitored.
Public propertySamplingInterval Gets or sets the interval, in milliseconds, at which the Counters are to be sampled.
(Inherited from PerformanceMonitorBase)
Public propertyStatus Gets the current status of the PerformanceMonitorBase object.
(Inherited from PerformanceMonitorBase)
Public propertyThreadCount Gets the PerformanceCounter that monitors the number of threads currently active in the monitored process.
Public propertyThreadingContentionRate Gets the PerformanceCounter that monitors the .NET threading contention rate / second of the process.
Top
Methods
 NameDescription
Public methodAddCounter(PerformanceCounter) Adds a PerformanceCounter to be monitored.
(Inherited from PerformanceMonitorBase)
Public methodAddCounter(String, String, String) Adds a PerformanceCounter to be monitored.
(Inherited from PerformanceMonitorBase)
Public methodAddCounter(String, String, String, String) Adds a PerformanceCounter to be monitored.
(Inherited from PerformanceMonitorBase)
Public methodAddCounter(String, String, String, String, String) Adds a PerformanceCounter to be monitored.
(Inherited from PerformanceMonitorBase)
Public methodAddCounter(String, String, String, String, String, Single, Boolean, FuncSingle, Single, FuncSingle, Boolean) Adds a PerformanceCounter to be monitored.
(Inherited from PerformanceMonitorBase)
Public methodDispose Releases all the resources used by the PerformanceMonitorBase object.
(Inherited from PerformanceMonitorBase)
Protected methodDispose(Boolean) Releases the unmanaged resources used by the PerformanceMonitorBase object and optionally releases the managed resources.
(Inherited from PerformanceMonitorBase)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Releases the unmanaged resources before the PerformanceMonitor object is reclaimed by GC.
(Overrides PerformanceMonitorBaseFinalize)
Public methodFindCounter(String) Returns a PerformanceCounter object matching the specified counter name.
(Inherited from PerformanceMonitorBase)
Public methodFindCounter(String, String) Returns a PerformanceCounter object matching the specified counter name.
(Inherited from PerformanceMonitorBase)
Public methodFindCounters(String) Returns PerformanceCounter array matching the specified counter name.
(Inherited from PerformanceMonitorBase)
Public methodFindCounters(String, String) Returns PerformanceCounter array matching the specified counter name.
(Inherited from PerformanceMonitorBase)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodRemoveCounter Removes a PerformanceCounter being monitored.
(Inherited from PerformanceMonitorBase)
Public methodSampleCounters Sample all defined counters.
(Inherited from PerformanceMonitorBase)
Protected methodSampleCustomCounters Handle sampling of custom counters.
(Overrides PerformanceMonitorBaseSampleCustomCounters)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Fields
 NameDescription
Public fieldStatic memberThreadPoolCountersCategoryName Name of the custom thread pool counters category.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Example
This example shows how to use PerformanceMonitor for monitoring application performance:
C#
using System;
using System.Threading;
using GSF.Diagnostics;

class Program
{
    static void Main(string[] args)
    {
        PerformanceMonitor perfMon = new PerformanceMonitor();
        while (true)
        {
            // Display process performance.
            Thread.Sleep(5000);
            Console.WriteLine("");
            Console.Write(perfMon.Status);
        }
    }
}
See Also