public void Should_measure_cpu_utilization() { var watch = Stopwatch.StartNew(); while (watch.Elapsed.TotalMilliseconds < 2000) { new SpinWait().SpinOnce(); } var metrics = collector.Collect(); metrics.CpuUtilizedCores.Should().BeGreaterThan(0); metrics.CpuUtilizedFraction.Should().BeGreaterThan(0).And.BeLessOrEqualTo(100); }
public void TestSetup() { collector = new HostMetricsCollector(); collector.Collect(); }