public CrudStressData(StressTestSettings settings, IDataGenerationProvider <T> dataGenerationProvider) { _settings = settings; _dataProvider = dataGenerationProvider; Generate(); }
public ResultsDisplayForm(StressTestIncomingResults results, StressTestOutgoingConfiguration configurations, StressTestSettings settings) { this.results = results; this.clientConfigurations = configurations; this.settings = settings; InitializeComponent(); }
private void onMessageReceived(object sender, MqttMsgPublishEventArgs getMsg) { string payload = Encoding.UTF8.GetString(getMsg.Message); StressTestIncomingResults results = JsonSerializer.Deserialize <StressTestIncomingResults>(payload); StressTestSettings settings = new StressTestSettings(); settings.BrokerHost = brokerIpAddrInput.Text; settings.BrokerPort = Int32.Parse(brokerPortInput.Text); settings.GracePeriod = (int)gracePeriod.Value; settings.NumClients = (int)numClients.Value; this.Invoke(new SafeCallDelegate(ShowResultsWindow), new object[] { results, new StressTestOutgoingConfiguration { Clients = this.clientConfigurations }, settings }); }
/// <summary> /// When returned to from the ResultsDisplayForm, populates the fields based off of the previously given data. /// </summary> /// <param name="settings">Base settings (i.e. broker IP, broker port, number of clients, grace period)</param> /// <param name="resultClientConfigurations">Client configurations (packet rate, duration, etc.)</param> public void GrabResultSettings(StressTestSettings settings, StressTestOutgoingConfiguration resultClientConfigurations) { // Sets field texts accordingly brokerIpAddrInput.Text = settings.BrokerHost; brokerPortInput.Text = settings.BrokerPort.ToString(); numClients.Value = settings.NumClients; gracePeriod.Value = settings.GracePeriod; // Updates this clientConfigurations files with the clients from the ResultsDisplayForm clientConfigurations = resultClientConfigurations.Clients; // Clears out current comboBox clientSelection.Items.Clear(); // Updates combobox values to be accurate to the newly populated clientConfigurations amounts for (int i = 1; i <= clientConfigurations.Count; i++) { clientSelection.Items.Add($"Client {i}"); } // Sets default index to 0 for good measure. clientSelection.SelectedIndex = 0; }
private void ShowResultsWindow(StressTestIncomingResults results, StressTestOutgoingConfiguration configuration, StressTestSettings settings) { ResultsDisplayForm resultForm = new ResultsDisplayForm(results, configuration, settings); resultForm.Show(); this.Hide(); }