Пример #1
0
        public void CpuLoads()
        {
            var observer = new EventHubObserver<CpuUsage>("cpuUsage");
            var random = new Random();
            while (true)
            {
                var e = new CpuUsage
                {
                    LogTime = DateTime.Now.ToUniversalTime()
                    ,
                    Deployment = _name
                    ,
                    Load = random.Next(0, 1000) / 10
                };

                observer.OnNext(e);
                Task.Delay(30000);
            }
        }
Пример #2
0
        public void CpuLoads()
        {
            var observer = new EventHubObserver <CpuUsage>("cpuUsage");
            var random   = new Random();

            while (true)
            {
                var e = new CpuUsage
                {
                    LogTime = DateTime.Now.ToUniversalTime()
                    ,
                    Deployment = _name
                    ,
                    Load = random.Next(0, 1000) / 10
                };

                observer.OnNext(e);
                Task.Delay(30000);
            }
        }