示例#1
0
        private static TracerIndentity Create(string tracerId, string spanId)
        {
            var tracer = new TracerIndentity();

            tracer._tracerId = tracerId;

            tracer._spanId = spanId;

            return(tracer);
        }
示例#2
0
        public static TracerIndentity Create()
        {
            var tracer = new TracerIndentity();

            //generate a tracerid
            //guid(length:32) + random(length:4)
            tracer._tracerId = Guid.NewGuid().ToString("N") + Rnd(1000, 9999).ToString();

            tracer._spanId = "0";

            return(tracer);
        }
示例#3
0
 public static TracerIndentity FromString(string s)
 {
     if (s.Contains(":"))
     {
         var splits = s.Split(Spliter, StringSplitOptions.RemoveEmptyEntries);
         return(TracerIndentity.Create(splits[0], splits[1]));
     }
     else
     {
         return(null);
     }
 }