public void EventFrameAFSDK2018SP3Patch1Check()
        {
            AFEventFrame ef = null;

            try
            {
                AFRpcMetric[] rpcBefore = Fixture.AFDatabase.PISystem.GetClientRpcMetrics();
                ef = new AFEventFrame(Fixture.AFDatabase, "OSIsoftTests_Patch2107Applied_EF1");
                ef.CheckIn();
                ef.SetEndTime("*");
                ef.CheckIn();
                AFRpcMetric[]       rpcAfter = Fixture.AFDatabase.PISystem.GetClientRpcMetrics();
                IList <AFRpcMetric> rpcDiff  = AFRpcMetric.SubtractList(rpcAfter, rpcBefore);
                foreach (AFRpcMetric rpcMetric in rpcDiff)
                {
                    Assert.False(rpcMetric.Name.Equals("getcheckoutinfo", StringComparison.InvariantCultureIgnoreCase), "Error: GetCheckOutInfo rpc was still called after Checkin with 2018 SP3 Patch 1!");
                }
            }
            finally
            {
                if (ef != null)
                {
                    ef.Delete();
                    Fixture.AFDatabase.PISystem.CheckIn();
                }
            }
        }
Exemple #2
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);
        }