Exemplo n.º 1
0
        /// <summary>
        /// 设置代理路径
        /// </summary>
        public void SetAgentPath(Agent parentAgent)
        {
            if (parentAgent == null)
            {
                AgentPath = Id.ToString();
            }
            else
            {
                AgentPath = parentAgent.AgentPath + "," + Id;

                //只要3级代理
                var p = AgentPath.Split(',').ToList();
                if (p.Count >= 3)
                {
                    p = p.GetRange(p.Count - 3, 3);
                }

                AgentPath = p.Join(",");
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 转换为JVM参数
 /// </summary>
 /// <returns></returns>
 public string ToArgument()
 {
     return($"-javaagent:"
            + (AgentPath.Contains(" ") ? $"\"{AgentPath}\"" : AgentPath)
            + $"={Parameter}");
 }