コード例 #1
0
        /// <summary>
        /// Get statistics about the server and the job handlers
        /// </summary>
        public ServerInfo GetStatistics()
        {
            var info = new ServerInfo();
            // RAM information
            var ci = new ComputerInfo();

            info.TotalMemory = ci.TotalPhysicalMemory;
            info.UsedMemory  = ci.TotalPhysicalMemory - ci.AvailablePhysicalMemory;
            // CPU information
            info.CpuUsage = CpuUsageReader.GetValue();
            // Handler statistics
            var handlerStats = _handlerManager.GetStatistics();

            info.Handlers.AddRange(handlerStats);
            // Client statistics
            info.Clients.AddRange(_clientManager.GetStatistics().OrderBy(i => i.ClientInfo.Name));
            return(info);
        }
コード例 #2
0
        /// <summary>
        /// Get statistics about the server and the job handlers
        /// </summary>
        public ServerInfo GetStatistics()
        {
            var info = new ServerInfo();
            // RAM information
            var ci = new ComputerInfo();

            info.TotalMemory = ci.TotalPhysicalMemory;
            info.UsedMemory  = ci.TotalPhysicalMemory - ci.AvailablePhysicalMemory;
            // CPU information
            info.CpuUsage = CpuUsageReader.GetValue();
            // Handler information
            var handlerStats = _handlerManager.GetStatistics();

            info.Handlers.AddRange(handlerStats);
            // Client information
            foreach (var kvp in _knownClients)
            {
                var clientInfo = kvp.Value;
                info.Clients.Add(clientInfo);
            }
            return(info);
        }