Beispiel #1
0
        static void Main(string[] args)
        {
            var commandLine = Args.Configuration.Configure <CommandLine>().CreateAndBind(args);

            IResourceHog hog = null;

            switch (commandLine.Resource)
            {
            case Resource.Memory:
                hog = new MemoryResourceHog(commandLine.Parameter);
                Thread.Sleep(20000);
                System.Console.WriteLine("In memory");
                WriteToFile();
                RequestSubmitter("http://front-end");
                Checker("http://www.example.com");
                Checker("http://windows-client-api:8080/supplier");
                Thread.Sleep(10000);
                break;

            case Resource.Cpu:
                hog = new CpuResourceHog(commandLine.Parameter);
                System.Console.WriteLine("In memory");
                Thread.Sleep(5000);
                WriteToFile();
                RequestSubmitter("http://front-end");
                Checker("http://www.example.com");
                Checker("http://windows-client-api:8080");
                break;
            }
            hog.Go();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var commandLine = Args.Configuration.Configure <CommandLine>().CreateAndBind(args);

            IResourceHog hog = null;

            switch (commandLine.Resource)
            {
            case Resource.Memory:
                hog = new MemoryResourceHog(commandLine.Parameter);
                break;

            case Resource.Cpu:
                hog = new CpuResourceHog(commandLine.Parameter);
                break;
            }
            hog.Go();
        }