diff --git a/ATxDiagnostics/ATxDiagnostics.cs b/ATxDiagnostics/ATxDiagnostics.cs index 073d61f31e82fa4ea5eed9d020f7e6e79be787ec..f3b80fb81e11a53514f5fe5ee46bd04fcc0914d3 100644 --- a/ATxDiagnostics/ATxDiagnostics.cs +++ b/ATxDiagnostics/ATxDiagnostics.cs @@ -35,15 +35,24 @@ namespace ATxDiagnostics Log.Info("ATxCommon library version: {0}", commonVersionInfo.ProductVersion); Log.Debug("Free space on drive [C:]: " + Conv.BytesToString(SystemChecks.GetFreeDriveSpace("C:"))); + + Log.Info("Checking CPU load using ATxCommon.Monitoring..."); var cpu = new Cpu { Interval = 250, Limit = 25, - Probation = 16, + Probation = 4, // 4 * 250 ms = 1 second Enabled = true }; - while (true) { + System.Threading.Thread.Sleep(10000); + cpu.Enabled = false; + Log.Info("Finished checking CPU load using ATxCommon.Monitoring.\n"); + + Log.Info("Checking CPU load using WMI..."); + for (int i = 0; i < 10; i++) { + WmiQueryCpuLoad(); System.Threading.Thread.Sleep(1000); } + Log.Info("Finished checking CPU load using WMI.\n"); } private static int WmiQueryCpuLoad() {