Пример #1
0
        public static double CpuUsed(string name)
        {
            var data = CurrentRedisClient.GetServerInfo(name);

            var before = 0D;

            var now = double.Parse(data.used_cpu_sys);

            if (_cpuUsed.ContainsKey(name))
            {
                before = _cpuUsed[name];
            }

            _cpuUsed[name] = now;

            return((now - before) * 100);
        }