コード例 #1
0
        static void Main(string[] args)
        {
            LoadTester loadTester = new LoadTester();

            loadTester.Run();

            PrinterTester printerTester = new PrinterTester();

            printerTester.Run(args);
            //printerTester.Run(args);
        }
コード例 #2
0
        private LoadTesterDetail CreateDetail(VirtualResource resource)
        {
            LoadTester tester = resource as LoadTester;

            LoadTesterDetail detail = new LoadTesterDetail
            {
                ResourceId    = tester.VirtualResourceId,
                ResourceType  = EnumUtil.Parse <VirtualResourceType>(tester.ResourceType),
                Name          = tester.Name,
                Description   = tester.Description,
                InstanceCount = tester.InstanceCount,
                Platform      = tester.Platform,
                Enabled       = tester.Enabled,
                ThreadsPerVM  = tester.ThreadsPerVM
            };

            CreateMetadataDetail(resource, detail);
            return(detail);
        }
コード例 #3
0
        /// <summary>
        /// Initializes this instance with the specified object.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <exception cref="ControlTypeMismatchException">
        /// Thrown when an object of incorrect type is passed to this instance.
        ///   </exception>
        public override void Initialize(object entity)
        {
            _loadTester = entity as LoadTester;
            if (_loadTester == null)
            {
                throw new ControlTypeMismatchException(entity, typeof(LoadTester));
            }

            // Load the configurations into the helper class
            LoadTesterConfiguration config = null;

            foreach (var item in _loadTester.VirtualResourceMetadataSet)
            {
                config          = new LoadTesterConfiguration();
                config.Metadata = item;

                if (item.ExecutionPlan == null)
                {
                    config.ExecutionPlan = new LoadTesterExecutionPlan();
                }
                else
                {
                    config.ExecutionPlan = LegacySerializer.DeserializeDataContract <LoadTesterExecutionPlan>(item.ExecutionPlan);
                }

                _configurations.Add(config);
            }

            // Load the activities into the binding list
            activity_GridView.DataSource = _configurations;
            activity_GridView.BestFitColumns();

            if (!GlobalSettings.IsDistributedSystem)
            {
                virtualMachinePlatform_ComboBox.Visible = false;
                platform_Label.Visible = false;
                _loadTester.Platform   = "LOCAL";
            }
            else
            {
                virtualMachinePlatform_ComboBox.SetPlatform(_loadTester.Platform, WorkerType);
            }

            name_TextBox.DataBindings.Add("Text", _loadTester, "Name");
            description_TextBox.DataBindings.Add("Text", _loadTester, "Description");

            // Set up execution thread count for the current plan
            maxThreadsPerVM_NumericUpDown.ValueChanged -= maxThreadsPerVM_NumericUpDown_ValueChanged;
            maxThreadsPerVM_NumericUpDown.Maximum       = 500;
            maxThreadsPerVM_NumericUpDown.Minimum       = 1;
            maxThreadsPerVM_NumericUpDown.Value         = _loadTester.ThreadsPerVM;
            maxThreadsPerVM_NumericUpDown.ValueChanged += maxThreadsPerVM_NumericUpDown_ValueChanged;

            CreateActivityDropDownMenu();

            if (_configurations.Count > 0)
            {
                // Select the first item in the list and then setup the databindings for that list.
                activity_GridView.Rows[0].IsSelected = true;
                var configuration = activity_GridView.Rows[0].DataBoundItem as LoadTesterConfiguration;
                SetupExecutionPlanBindings(configuration);
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: edisongt/MTVersionHFOOAD
        static void Main(string[] args)
        {
            LoadTester loadTester = new LoadTester();

            loadTester.RunLoadTests();
        }