A class that uses the System.Management APIS (WMI) to fetch the most interesting attributes about the computer hardware we are running on. Based on Vance Morrison's MeasureIt tool: http://blogs.msdn.com/b/vancem/archive/2009/02/06/measureit-update-tool-for-doing-microbenchmarks.aspx
Beispiel #1
0
        public PerformanceTestSession(ScenarioType scenarioType, ImplementationType implementationType, int runs)
        {
            _scenarioType       = scenarioType;
            _implementationType = implementationType;
            _runs = runs;
            _computerSpecifications = new ComputerSpecifications();
            Console.WriteLine("Scenario={0}, Implementation={1}, Runs={2}", scenarioType, implementationType, runs);

            if (scenarioType == ScenarioType.All)
            {
                foreach (var scenarioName in Enum.GetNames(typeof(ScenarioType)).Where(s => s != "All"))
                {
                    _scenarios.Add(new Scenario(scenarioName, implementationType, runs, _computerSpecifications.NumberOfCores));
                }
            }
            else
            {
                string scenarioName = scenarioType.ToString();
                _scenarios.Add(new Scenario(scenarioName, implementationType, runs, _computerSpecifications.NumberOfCores));
            }
        }
        public PerformanceTestSession(ScenarioType scenarioType, ImplementationType implementationType, int runs)
        {
            _scenarioType = scenarioType;
            _implementationType = implementationType;
            _runs = runs;
            _computerSpecifications = new ComputerSpecifications();
            Console.WriteLine("Scenario={0}, Implementation={1}, Runs={2}", scenarioType, implementationType, runs);

            if (scenarioType == ScenarioType.All)
            {
                foreach (var scenarioName in Enum.GetNames(typeof(ScenarioType)).Where(s => s != "All"))
                {
                    _scenarios.Add(new Scenario(scenarioName, implementationType, runs, _computerSpecifications.NumberOfCores));
                }
            }
            else
            {
                string scenarioName = scenarioType.ToString();
                _scenarios.Add(new Scenario(scenarioName, implementationType, runs, _computerSpecifications.NumberOfCores));
            }
        }