public Form1() { InitializeComponent(); consistencyChoices = new List <string> { "strong consistency", "causal consistency", "bounded staleness", "read my writes", "monotonic freshness", "eventual consistency" }; consistencyListBox.DataSource = consistencyChoices; consistencyListBox.ClearSelected(); readWriteWorker = new BackgroundWorker(); readWriteWorker.DoWork += new DoWorkEventHandler(ReadWriteWorker_DoWork); readWriteWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(ReadWriteWorker_Completed); Print("Running demo program..."); DemoLib.RegisterLogger(Print); // // Create initial configuration // Print("Reading configuration..."); DemoLib.Initialize(); Print(DemoLib.PrintCurrentConfiguration()); // Read sample data from file Print("Reading file data..."); initialSampler = DemoLib.NewSampler(); reconfigSampler = DemoLib.NewSampler(); DemoLib.ReadDataFile(initialSampler); Print(DemoLib.PrintReadWriteTimes(initialSampler)); // Ping servers to measure and record round-trip times in the server state Print("Pinging servers..."); DemoLib.PingAllServers(); Print("Round-trip latencies to sites:"); Print(DemoLib.PrintServerRTTs()); }
private void buttonPingLatency_Click(object sender, EventArgs e) { DemoLib.PingAllServers(); buttonGetLatency_Click(sender, e); }