public NodeAgent Get(string name) { NodeAgent result = null; mNodes.TryGetValue(name, out result); return(result); }
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); }
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); }
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); }
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); }
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); } }
public void Ping(Network.NodePing ping, ISession session) { NodeAgent agent = GetOrCreateNode(ping.Name, session); agent.PerformanceInfo = ping.PerformanceInfo; }