public string Exec() { PcsManager pcs = PcsPool.GetByPid(pid); if (pcs != null) { string localState = pcs.LocalState(pid, roundId); string filePath = "../OGP/PuppetMaster/bin/Debug/LocalState/"; string filename = String.Format("LocalState-{0}-{1}", pid, roundId); string directory = Path.Combine(System.Environment.CurrentDirectory, filePath); Directory.CreateDirectory(directory); StreamWriter file = new StreamWriter(directory + filename) { AutoFlush = true, NewLine = Environment.NewLine }; using (file) { file.Write(localState); file.Close(); } Console.WriteLine(String.Format("State written to {0}", directory + filename)); return(localState); } return(String.Empty); }
public string Exec() { PcsManager pcs = PcsPool.GetByPid(pid); if (pcs != null) { pcs.Unfreeze(pid); } return(String.Empty); }
public string Exec() { PcsManager pcs = PcsPool.GetByPid(srcPid); if (pcs != null) { pcs.InjectDelay(srcPid, dstPid); } return(String.Empty); }
public string Exec() { StringBuilder result = new StringBuilder(); foreach (string pid in PcsPool.GetAllPids()) { PcsManager pcs = PcsPool.GetByPid(pid); if (pcs != null) { string globalStatus = pcs.GlobalStatus(pid); result.Append(globalStatus); } } return(result.ToString()); }