ProcessMetrics
A class in Root.Township, the global namespace.
Old CPU and RAM sampler for one Process, marked obsolete in favour of the new analytics system. Creating one starts a background thread that samples CPU once a second until Stop.
- Listed in Global namespace: P
- Nested types
MemoryCounters - Attributes
Obsolete
Constructors
| Member | What it is |
|---|---|
ProcessMetrics(Process process) | Creates a ProcessMetrics from process. |
Fields
7 private and internal fields
Properties
Methods
| Member | What it is |
|---|---|
void Stop() | Ends the sampler thread after its current one-second sleep. |
3 private and internal methods
| Member | What it is |
|---|---|
private static bool GetProcessMemoryInfo(IntPtr processHandle, out ProcessMetrics.MemoryCounters info, int Size) | Native psapi.dll call that fills a MemoryCounters for a process handle. Windows only; RAM uses it. |
private void UpdateMetric() | Works out CPU from the processor time used since the last sample. Called by UpdateMetricLoop. |
private void UpdateMetricLoop() | Body of the background thread: calls UpdateMetric every second while isRunning is true. |
Used in
Members of other types that take, return or hold a ProcessMetrics: