コード例 #1
0
        private static void GenerateCalls(LoadTest currentLoadTest)
        {
            var animation = new List <string>
            {
                "<(O_o )>",
                "^(O.o )>",
                "(O.o )>;= ",
                "(O.o )>;= -",
                "(O.o )>;=   -",
                "(O.o )>;= -   -",
                "(O.o )>;= -   -   -",
                "(O.o )>;= -   -   -   -",
                "(O.o )>;= -   -   -   -   -",
                "(O.o )>;= -   -   -   -   -   -",
                "(O.o )>;=     -   -   -   -   -   *",
                "(O.o )>;=         -   -   -   -   *",
                "(O.o )>;=             -   -   -   *",
                "(O.o )>;=                     -   *",
                "(O.o )>;=~                         ",
            };

            var cursorLeft = Console.CursorLeft;
            var cursorTop  = Console.CursorTop;


            var factory   = new ProcessFactory(currentLoadTest.Clients, currentLoadTest.MessagesByClient);
            var processes = factory.Processes;

            cursorLeft = Console.CursorLeft;
            cursorTop  = Console.CursorTop;
            var waiter = new ConsoleWaiter(cursorLeft, cursorTop, 400, animation);

            waiter.Start();

            factory.Excecute(currentLoadTest.Id);

            waiter.Stop();

            Console.WriteLine("All threads are complete !!");

            Wait(currentLoadTest.TotalSendedMessages);
        }