예제 #1
0
        private XElement SaveMethod(MethodTracerResult methodTracer)
        {
            XElement savedTracedMetod = new XElement("Method",
                                                     new XAttribute("Name", methodTracer.MethodName),
                                                     new XAttribute("Time", methodTracer.Time.Milliseconds + "ms"),
                                                     new XAttribute("Class", methodTracer.ClassName));

            if (methodTracer.lInnerMethodTracerResults.Any())
            {
                savedTracedMetod.Add(from innerMethod in methodTracer.lInnerMethodTracerResults
                                     select SaveMethod(innerMethod));
            }
            return(savedTracedMetod);
        }
예제 #2
0
        public static ThreadTracerResult GetTraceResult(ThreadTracer threadTracer)
        {
            ThreadTracerResult threadTracerResult = new ThreadTracerResult();

            threadTracerResult.lFirstLvlMethodTracersResult = new List <MethodTracerResult>();
            threadTracerResult.Id   = threadTracer.Id;
            threadTracerResult.Time = threadTracer.Time;

            foreach (var firstLvlMethodTracer in threadTracer.lFirstLvlMethodTracers)
            {
                threadTracerResult.lFirstLvlMethodTracersResult.Add(MethodTracerResult.GetTraceResult(firstLvlMethodTracer));
            }

            return(threadTracerResult);
        }
예제 #3
0
        public static MethodTracerResult GetTraceResult(MethodTracer methodTracer)
        {
            MethodTracerResult methodTracerResult = new MethodTracerResult();

            methodTracerResult.ClassName  = methodTracer.ClassName;
            methodTracerResult.MethodName = methodTracer.MethodName;
            methodTracerResult.Time       = methodTracer.Time;
            methodTracerResult.lInnerMethodTracerResults = new List <MethodTracerResult>();

            foreach (var innerMethodTracer in methodTracer.lInnerMethodTracers)
            {
                methodTracerResult.lInnerMethodTracerResults.Add(MethodTracerResult.GetTraceResult(innerMethodTracer));
            }

            return(methodTracerResult);
        }
예제 #4
0
        private JToken SaveMethods(MethodTracerResult methodTracerResult)
        {
            var savedTracedMetod = new JObject
            {
                { "Name", methodTracerResult.MethodName },
                { "Class", methodTracerResult.ClassName },
                { "Time", methodTracerResult.Time.Milliseconds + "ms" }
            };

            if (methodTracerResult.lInnerMethodTracerResults.Any())
            {
                savedTracedMetod.Add("Methods", new JArray(from mt in methodTracerResult.lInnerMethodTracerResults
                                                           select SaveMethods(mt)));
            }
            return(savedTracedMetod);
        }