Esempio n. 1
0
        public NodeAgent Get(string name)
        {
            NodeAgent result = null;

            mNodes.TryGetValue(name, out result);
            return(result);
        }
Esempio n. 2
0
        public void OnReport(StatisticalReport e)
        {
            Loger.Process(LogType.INFO, "update {0}:{1} unit test report", e.Node, e.UnitTest);
            NodeAgent agent = NodeManager.Get(e.Node);

            agent.SetUnitTestStatistal(e.UnitTest, e);
        }
Esempio n. 3
0
        public StopTestCaseResponse OnStopTest(StopTestCase e)
        {
            Loger.Process(LogType.INFO, "stop {0} with {1}", e.UnitTest, string.Join(",", e.Nodes));
            StopTestCaseResponse result = new Network.StopTestCaseResponse();

            foreach (string node in e.Nodes)
            {
                NodeAgent agent = NodeManager.Get(node);
                agent.StopTest(e);
            }
            return(result);
        }
Esempio n. 4
0
        public GetUnitTestReportReponse OnGetUnitTestReport(GetUnitTestReport e)
        {
            GetUnitTestReportReponse response = new Network.GetUnitTestReportReponse();

            foreach (string node in e.Nodes)
            {
                NodeAgent         agent = NodeManager.Get(node);
                StatisticalReport item  = agent.GetUnitTestStatistal(e.UnitTest);
                if (item != null)
                {
                    response.Items.Add(item);
                }
            }
            return(response);
        }
Esempio n. 5
0
        public RunTestcaseResponse OnRunTest(RunTestcase e)
        {
            PacketDecodeCompletedEventArgs pdce = RouteCenter.CurrentContext.GetToken <PacketDecodeCompletedEventArgs>();

            Loger.Process(LogType.INFO, "runing {0}:{1} with {2}", e.UnitTest, e.TestCase, string.Join(",", e.Nodes));
            RunTestcaseResponse result = new Network.RunTestcaseResponse();

            foreach (string node in e.Nodes)
            {
                NodeAgent agent = NodeManager.Get(node);
                agent.RunTest(e);
            }
            mUnitTestManagers[e.UnitTest] = pdce.Session;
            return(result);
        }
Esempio n. 6
0
 private NodeAgent GetOrCreateNode(string name, ISession session)
 {
     lock (mNodes)
     {
         NodeAgent result;
         if (!mNodes.TryGetValue(name, out result))
         {
             result       = new NodeAgent(Center, name, session.RemoteEndPoint);
             mNodes[name] = result;
         }
         result.LastActiveTime = Center.TimeWatch.ElapsedMilliseconds;
         result.Session        = session;
         return(result);
     }
 }
Esempio n. 7
0
        public void Ping(Network.NodePing ping, ISession session)
        {
            NodeAgent agent = GetOrCreateNode(ping.Name, session);

            agent.PerformanceInfo = ping.PerformanceInfo;
        }