0
我知道如何獲取當前進程的性能計數器。但是,是否有可能從子進程及其所有子進程中獲得子進程:子進程是 a)託管代碼 b)本機二進制文件?是否可以將PerformanceCounter放在進程樹上
我知道如何獲取當前進程的性能計數器。但是,是否有可能從子進程及其所有子進程中獲得子進程:子進程是 a)託管代碼 b)本機二進制文件?是否可以將PerformanceCounter放在進程樹上
子進程InstanceName
s是附加#n的父名。這樣做可能會有所幫助。以下是所有Chrome進程的處理器時間總和:
(new PerformanceCounterCategory("Process"))
.GetInstanceNames()
.Where(a => a.StartsWith("chrome"))
.Select(a => new PerformanceCounter("Process", "% Processor Time", a).NextValue())
.Sum()