Beispiel #1
0
        private void buttonGetLatency_Click(object sender, EventArgs e)
        {
            ServerMonitor        monitor     = DemoLib.GetServerMonitor();
            ReplicaConfiguration config      = DemoLib.GetCurrentConfiguration();
            List <string>        allServers  = config.GetServers();
            List <string>        siteNames   = new List <string>();
            List <string>        siteLatency = new List <string>();

            foreach (string server in allServers)
            {
                ServerState ss = monitor.GetServerState(server);
                siteNames.Add(DemoLib.SiteName(server));
                siteLatency.Add(ss.RTTs.FindAverage().ToString("F0").PadLeft(5));
            }

            listBoxLatencySites.DataSource = null;
            listBoxLatencySites.DataSource = siteNames;
            listBoxLatencySites.ClearSelected();
            listBoxLatencyTimes.DataSource = null;
            listBoxLatencyTimes.DataSource = siteLatency;
            listBoxLatencyTimes.ClearSelected();
        }