示例#1
0
 private void restroreConfigButton_Click(object sender, EventArgs e)
 {
     configTextBox.Clear();
     configTextBox.AppendText("Restoring initial configuration...");
     DemoLib.SetInitialConfiguration();
     initialConfig = true;
     configTextBox.Clear();
     configTextBox.AppendText(DemoLib.PrintCurrentConfiguration() + "\n");
 }
示例#2
0
 private void installNewConfigButton_Click(object sender, EventArgs e)
 {
     configTextBox.Clear();
     configTextBox.AppendText("Installing new configuration...");
     DemoLib.InstallNewConfiguration();
     initialConfig   = false;
     reconfigSampler = DemoLib.NewSampler();
     configTextBox.Clear();
     configTextBox.AppendText(DemoLib.PrintCurrentConfiguration() + "\n");
 }
示例#3
0
        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());
        }
示例#4
0
 private void getConfigButton_Click(object sender, EventArgs e)
 {
     configTextBox.Clear();
     configTextBox.AppendText(DemoLib.PrintCurrentConfiguration() + "\n");
 }