Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public void TestSetup()
 {
     collector = new HostMetricsCollector();
     collector.Collect();
 }