Exemple #1
0
        public void RegisterDispatcher(string url, float cpu)
        {
            MachinePerformance m = _performanceList.Find(t => t.Url == url);

            if (m == null)
            {
                m = new MachinePerformance
                {
                    Url     = url,
                    CpuRate = cpu,
                };
                _performanceList.Add(m);
            }
            else
            {
                m.CpuRate = cpu;
            }
        }
Exemple #2
0
        public string GetMinCpuDispatcher()
        {
            MachinePerformance performance = null;

            foreach (var m in _performanceList)
            {
                if (performance == null || performance.CpuRate > m.CpuRate)
                {
                    performance = m;
                }
            }
            string url = "";

            if (performance != null)
            {
                url = performance.Url;
            }
            return(url);
        }