示例#1
0
        public static void VMStateTest()
        {
            string  MpcVmConfigpath = @"C:\Users\CBY\Documents\代码库\0106\FieldManagerUI\FieldManagerUI\bin\UsefulFile\VMState.json";
            VMState vMState         = new VMState(MpcVmConfigpath);

            //VMState.ReceiveMessage();
            vMState.StartMessageReceiver();
            //Console.ReadLine();
        }
示例#2
0
        public static void CopyFileTest()
        {
            string MpcVmConfigpath = @"C:\Users\CBY\Documents\代码库\0106\FieldManagerUI\FieldManagerUI\bin\UsefulFile\VMState.json";

            if (!System.IO.File.Exists(MpcVmConfigpath))
            {
                Console.WriteLine("路径" + MpcVmConfigpath + "下,MPC配置文件不存在");
                return;
            }
            VMState vMState = new VMState(MpcVmConfigpath);
            int     ret     = VMState.LocalVM.CopyFileToGuest("LocalVM", GetConfig.LocalVMProcessInfoPath, @"C:\TEMP\\ProcConfig.json");

            Console.WriteLine("ret is" + Convert.ToString(ret));
        }
示例#3
0
        static void Main(string[] args)
        {
#if MPC
            string MpcVmConfigpath = @"C:\Users\CBY\Documents\代码库\0106\FieldManagerUI\FieldManagerUI\bin\UsefulFile\VMState.json";
            if (!File.Exists(MpcVmConfigpath))
            {
                Console.WriteLine("路径" + MpcVmConfigpath + "下,多域PC虚拟机配置文件不存在");
                return;
            }
            VMState vMState = new VMState(MpcVmConfigpath);
            vMState.StartMessageReceiver();
#else
            VMState vMState = new VMState();
            vMState.StartDetectVMState(5000);
#endif
#if VMMemStatistic
            // 统计各个VM的内存使用情况,输出到Excel
            CommonUtility.GetVMMemoryUsage(5000);
#endif
            InitVMSetting initVMSetting = new InitVMSetting();
            initVMSetting.InitAllVM();

            string HvAddr         = "hypervnb://00000000-0000-0000-0000-000000000000/C7240163-6E2B-4466-9E41-FF74E7F0DE47";
            Server detectorServer = new Server(HvAddr);
            var    task           = new Task(() =>
            {
                detectorServer.StartUpServer();
            });
            task.Start();

            LoadBalancer currentBalancer = new LoadBalancer(80.0, 1, 85.0, 3, 3, 10000, 200000);
            currentBalancer.setDetectorServer(detectorServer);
            currentBalancer.BalanceByTime();
            Console.WriteLine("负载均衡器(HvBalancer)启动成功!");
            // 按s键退出
            while (true)
            {
                string input = Console.ReadLine();
                if (input == "s")
                {
                    return;
                }
            }
        }