Exemplo n.º 1
0
        public void StopTrace()
        {
            int threadId = Thread.CurrentThread.ManagedThreadId;
            MethodTraceResult lastMethod = Traceresult.Threads[threadId].LastStackMethods.Pop();

            lastMethod.StopTrace();
        }
Exemplo n.º 2
0
 public void AddChildMethod(MethodTraceResult child)
 {
     if (child != null)
     {
         this.Methods.Add(child);
     }
     else
     {
         return;
     }
 }
Exemplo n.º 3
0
        public void StartTrace()
        {
            Calculated = false;
            int               threadId   = Thread.CurrentThread.ManagedThreadId;
            var               thread     = Traceresult.Threads.GetOrAdd(threadId, (_) => new ThreadTraceResult((uint)threadId));
            StackTrace        Stacktrace = new StackTrace();
            MethodBase        method     = Stacktrace.GetFrame(1).GetMethod();
            MethodTraceResult Newmethod  = new MethodTraceResult(method.Name, method.ReflectedType.Name);

            Newmethod.StartTrace();

            if (thread.LastStackMethods.Count() != 0)
            {
                thread.LastStackMethods.Peek().AddChildMethod(Newmethod);
            }
            else
            {
                thread.Methods.Add(Newmethod);
            }
            thread.LastStackMethods.Push(Newmethod);
        }