Exemple #1
0
 public void DisplayStatistics(Object userData)
 {
     StatsHolder.Dump("engine");
     StatsHolder.Dump("server");
     StatsHolder.Dump("endToEnd");
     StatsHolder.Reset();
     if (simulationRate <= 0)
     {
         ClientConnection.DumpStats(statSec);
     }
     else
     {
         SimulateClientConnection.DumpStats(statSec);
     }
 }
Exemple #2
0
        /// <summary>
        /// Runs the simulation.
        /// </summary>
        public void RunSimulation()
        {
            Console.WriteLine(
                "Server in sumulation mode with event/s {0} x {1} = {2}",
                simulationThread,
                simulationRate,
                simulationThread * simulationRate);

            SimulateClientConnection[] sims = new SimulateClientConnection[simulationThread];
            for (int i = 0; i < sims.Length; i++)
            {
                sims[i] = new SimulateClientConnection(simulationRate, simulationIterations, executor, cepProvider, statSec);
                sims[i].Start();
            }

            foreach (SimulateClientConnection sim in sims)
            {
                sim.WaitForCompletion();
            }
        }
        public static void DumpStats(int statSec)
        {
            long totalCount = 0;
            int  cnx        = 0;
            SimulateClientConnection any = null;

            lock (CLIENT_CONNECTIONS_LOCK)
            {
                foreach (SimulateClientConnection m in CLIENT_CONNECTIONS.Values)
                {
                    cnx++;
                    totalCount += m.countLast10sLast;
                    any         = m;
                }
            }
            if (any != null)
            {
                Console.WriteLine("Throughput {0:F}", (float)totalCount / statSec);
            }
        }