Beispiel #1
0
        public void Dispose()
        {
            _sw.Stop();
            Console.WriteLine("Operation {0} took: {1} ms\n", _name, _sw.ElapsedMilliseconds);

            AFRpcMetric[] endClient  = _piSystem.GetClientRpcMetrics();
            AFRpcMetric[] endServer  = _piSystem.GetRpcMetrics();
            var           diffClient = AFRpcMetric.SubtractList(endClient, _startClient);
            var           diffServer = AFRpcMetric.SubtractList(endServer, _startServer);

            long numCalls = 0;

            Console.WriteLine("RPC Metrics");
            foreach (var clientMetric in diffClient)
            {
                foreach (var serverMetric in diffServer)
                {
                    if (clientMetric.Name == serverMetric.Name)
                    {
                        numCalls += clientMetric.Count;
                        Console.WriteLine("   {0}: {1} calls.  {2} ms/call on client. {3} ms/call on server.  Delta: {4} ms/call",
                                          clientMetric.Name,
                                          clientMetric.Count,
                                          Math.Round(clientMetric.MillisecondsPerCall),
                                          Math.Round(serverMetric.MillisecondsPerCall),
                                          Math.Round(clientMetric.MillisecondsPerCall - serverMetric.MillisecondsPerCall));
                        break;
                    }
                }
            }
            Console.WriteLine();
            Console.WriteLine("Total RPCs: {0}", numCalls);
        }
        public AFProbe(string name, PISystem piSystem)
        {
            _name = name;
            _piSystem = piSystem;

            _startServer = piSystem.GetRpcMetrics();
            _startClient = piSystem.GetClientRpcMetrics();

            _sw = Stopwatch.StartNew();
        }
Beispiel #3
0
        public AFProbe(string name, PISystem piSystem)
        {
            _name     = name;
            _piSystem = piSystem;

            _startServer = piSystem.GetRpcMetrics();
            _startClient = piSystem.GetClientRpcMetrics();

            _sw = Stopwatch.StartNew();
        }