ProcessDataPerfInfoPushProvider Class |
Namespace: Xcalibur.WMI.Processes
The ProcessDataPerfInfoPushProvider type exposes the following members.
Name | Description | |
---|---|---|
ProcessDataPerfInfoPushProvider |
Initializes a new instance of the
ProcessDataPerfInfoPushProvider class.
|
Name | Description | |
---|---|---|
Id |
Gets or sets the id.
(Inherited from WmiModelBaseTData, TDataModel.) | |
QueryBuilder |
Gets or sets the query items.
Note: This is only used for Pull implementations.
(Inherited from WmiModelBaseTData, TDataModel.) | |
Results |
List of results from GetResults or GetResultsAsync.
This has been made public in the event that an alternate method will be used
outside of this class.
(Inherited from WmiModelBaseTData, TDataModel.) | |
WmiClass |
WMI class that corresponds to the searcher.
(Inherited from WmiModelBaseTData, TDataModel.) |
Name | Description | |
---|---|---|
CreateWatcher |
Creates the event watcher.
(Inherited from WmiPushModelBaseTData, TDataModel.) | |
Dispose |
Implement IDisposable.
Do not make this method virtual.
A derived class should not be able to override this method.
(Inherited from WmiModelBaseTData, TDataModel.) | |
Dispose(Boolean) |
Dispose(bool disposing) executes in two distinct scenarios.
If disposing equals true, the method has been called directly
or indirectly by a user's code. Managed and unmanaged resources
can be disposed.
If disposing equals false, the method has been called by the
runtime from inside the finalizer and you should not reference
other objects. Only unmanaged resources can be disposed.
(Inherited from WmiPushModelBaseTData, TDataModel.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Get |
Gets the specified object.
(Inherited from WmiModelBaseTData, TDataModel.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Start |
Starts this instance.
(Inherited from WmiPushModelBaseTData, TDataModel.) | |
Stop |
Stops this instance.
(Inherited from WmiPushModelBaseTData, TDataModel.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Update(Int32) |
Updates this instance.
(Inherited from WmiPushModelBaseTData, TDataModel.) | |
UpdateTConfig(TConfig, Int32) |
Updates the specified configuration.
(Inherited from WmiModelBaseTData, TDataModel.) |
Name | Description | |
---|---|---|
ItemsAdded |
Occurs when [items added].
(Inherited from WmiPushModelBaseTData, TDataModel.) | |
ItemsDeleted |
Occurs when [items deleted].
(Inherited from WmiPushModelBaseTData, TDataModel.) | |
ItemsModified |
Occurs when [items modified].
(Inherited from WmiPushModelBaseTData, TDataModel.) |
1// Main 2private static void Main() 3{ 4 // Make a connection to the local machine 5 const string computer = "."; 6 var managementScope = new ManagementScope($@"\\{computer}\root\cimv2", new ConnectionOptions 7 { 8 Impersonation = ImpersonationLevel.Impersonate, 9 Authentication = AuthenticationLevel.Connect 10 }); 11 managementScope.Connect(); 12 13 // Process performance data configuration 14 // We need to specify what we want to retrieve 15 var config = new ProcessPerfDataConfig 16 { 17 IDProcess = true, 18 Name = true, 19 WorkingSet = true, 20 WorkingSetPrivate = true, 21 Timestamp_Sys100NS = true 22 }; 23 24 // Process performance data information on a 1-second polling cycle for Process ID: 19248 25 var provider = new ProcessDataPerfInfoPushProvider(managementScope, config, 1000, 19248); 26 27 // Items Added 28 provider.ItemsAdded += (item, e) => 29 { 30 Console.WriteLine("Event: Item Added"); 31 Console.WriteLine($"{item.IDProcess}: \t{item.Name}"); 32 Console.WriteLine(""); 33 }; 34 35 // Items Modified 36 provider.ItemsModified += (item, e) => 37 { 38 Console.WriteLine("Event: Item Modified"); 39 Console.WriteLine($"{item.IDProcess}: \t{item.Name}"); 40 41 // We chose these values because we know they will constantly increase 42 Console.WriteLine($"Working Set: \t\t{item.WorkingSet}"); 43 Console.WriteLine($"Private Working Set: \t{item.WorkingSetPrivate}"); 44 Console.WriteLine($"Timestamp: \t\t{item.TimestampSys100Ns}"); 45 Console.WriteLine(""); 46 }; 47 48 // Items Deleted 49 provider.ItemsDeleted += (item, e) => 50 { 51 Console.WriteLine("Event: Item Deleted"); 52 Console.WriteLine($"{item.IDProcess}: \t{item.Name}"); 53 Console.WriteLine(""); 54 }; 55 56 // Read 57 Console.Read(); 58} 59 60/* Results: 61 * 62 * Event: Item Added 63 * 19248: WindowsDashboard 64 * 65 * Event: Item Modified 66 * 19248: WindowsDashboard 67 * Working Set: 114995200 68 * Private Working Set: 49004544 69 * Timestamp: 131654592956557516 70 * 71 * Event: Item Modified 72 * 19248: WindowsDashboard 73 * Working Set: 115326976 74 * Private Working Set: 49336320 75 * Timestamp: 131654592978271674 76 * 77 * Event: Item Modified 78 * 19248: WindowsDashboard 79 * Working Set: 115331072 80 * Private Working Set: 49340416 81 * Timestamp: 131654593000080330 82 * 83 * Event: Item Modified 84 * 19248: WindowsDashboard 85 * Working Set: 115331072 86 * Private Working Set: 49373184 87 * Timestamp: 131654593022029765 88 * 89 * Event: Item Modified 90 * 19248: WindowsDashboard 91 * Working Set: 115331072 92 * Private Working Set: 49373184 93 * Timestamp: 131654593044073874 94 * 95 * Event: Item Modified 96 * 19248: WindowsDashboard 97 * Working Set: 114966528 98 * Private Working Set: 49008640 99 * Timestamp: 131654593065870185 100 * 101 * Event: Item Modified 102 * 19248: WindowsDashboard 103 * Working Set: 114974720 104 * Private Working Set: 49016832 105 * Timestamp: 131654593087916491 106 * 107 * Event: Item Modified 108 * 19248: WindowsDashboard 109 * Working Set: 115290112 110 * Private Working Set: 49332224 111 * Timestamp: 131654593109661946 112 * 113 */