private TracingThreadInfo GetOrCreateTracingTreadInfo(int threadId) { if (threadsMap.ContainsKey(threadId)) { return(threadsMap[threadId]); } ThreadTraceResult threadTraceResult = new ThreadTraceResult(threadId); TracingThreadInfo tracingThreadInfo = new TracingThreadInfo(threadTraceResult); return(threadsMap[threadId] = tracingThreadInfo); }
public int GetSummOfMethodsWorkTimes(int Indexofthread) { if (this.Threads.IsEmpty || !this.Threads.Keys.Contains(Indexofthread)) { return(-1); } double result = 0; ThreadTraceResult Threadtraceresult = this.Threads[Indexofthread]; foreach (MethodTraceResult method in Threadtraceresult.Methods) { result += Math.Round(method.WorkTime + GetSummOfInnerMethodsWorkTimes(method.Methods)); } return((int)Math.Truncate(result)); }
public TracingThreadInfo(ThreadTraceResult threadTraceResult) { ThreadTraceResult = threadTraceResult; TracingStack = new Stack <TracingMethodInfo>(); IsEmptyThread = true; }