Example #1
0
 public Core(
     ITraceData traceData
     )
     : base(traceData)
 {
     // do nothing.
 }
Example #2
0
 public void Register(string name, ITraceData traceData)
 {
     if (_traceDataRegistry.ContainsKey(name))
         //throw new PBException("can't register TraceData, TraceData \"{0}\" already exist", name);
         _traceDataRegistry.Remove(name);
     _traceDataRegistry.Add(name, traceData);
 }
Example #3
0
 public void Register(string name, ITraceData traceData)
 {
     if (_traceDataRegistry.ContainsKey(name))
     {
         //throw new PBException("can't register TraceData, TraceData \"{0}\" already exist", name);
         _traceDataRegistry.Remove(name);
     }
     _traceDataRegistry.Add(name, traceData);
 }
Example #4
0
        public Default(
            ITraceData traceData
            )
        {
            kind = IdentifierKind.Trace;

            //
            // VIRTUAL: Id of the deepest derived class.
            //
            id = AttributeOps.GetObjectId(this);

            //
            // VIRTUAL: Group of the deepest derived class.
            //
            group = AttributeOps.GetObjectGroup(this);

            //
            // NOTE: Is the supplied trace data valid?
            //
            if (traceData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, traceData.Group);

                name         = traceData.Name;
                description  = traceData.Description;
                typeName     = traceData.TypeName;
                methodName   = traceData.MethodName;
                bindingFlags = traceData.BindingFlags;
                methodFlags  = traceData.MethodFlags;
                token        = traceData.Token;
                traceFlags   = traceData.TraceFlags;
                plugin       = traceData.Plugin;
                clientData   = traceData.ClientData;
            }

            callback = null;
        }
Example #5
0
        /// <summary>创建一批采样数据</summary>
        /// <param name="data"></param>
        /// <param name="spans"></param>
        /// <returns></returns>
        public static IList <SampleData> Create(ITraceData data, IList <ISpan> spans)
        {
            var list = new List <SampleData>();

            if (spans == null || spans.Count == 0)
            {
                return(list);
            }

            foreach (var item in spans)
            {
                var sd = new SampleData
                {
                    DataId = data.ID,
                    AppId  = data.AppId,
                    Name   = data.Name,

                    TraceId  = item.TraceId,
                    SpanId   = item.Id,
                    ParentId = item.ParentId,

                    StartTime = item.StartTime,
                    EndTime   = item.EndTime,

                    Tag   = item.Tag,
                    Error = item.Error,

                    Success = item.Error.IsNullOrEmpty(),

                    CreateIP   = data.CreateIP,
                    CreateTime = DateTime.Now,
                };
                list.Add(sd);
            }

            return(list);
        }
Example #6
0
 public void SetModuleTask(ISequenceManager Seq)
 {
     m_IModuleTask  = Seq;
     m_TraceService = (ITraceData)m_IModuleTask.GetService(typeof(ITraceData));
 }
Example #7
0
 public void Add(ITraceData data)
 {
     this.Data.Add(data);
 }