public TracingCallTreeConvertor(IEnumerable<TracingCallTree> tracingCallTrees)
        {
            _globalAggregatedValues = new TracingGlobalAggregatedValues();

            var flattenedTreeList = new List<TracingCallTreeElem>();
            foreach (TracingCallTree callTree in tracingCallTrees)
            {
                _globalAggregatedValues.TotalActiveTime += callTree.UserModeDurationHns + callTree.KernelModeDurationHns;
                FlattenCallTree(callTree.RootElem, flattenedTreeList);
            }

            _aggregators = flattenedTreeList.GroupBy(
                elem => elem.MethodMetadata).Select(
                    grouping =>
                        {
                            MethodMetadata methodMetadata = grouping.Key;
                            var aggregator = new TracingMethodAggregator(methodMetadata);
                            aggregator.AggregateRange(grouping);
                            return aggregator;
                        });

            _globalAggregatedValues.TotalCycleTime = _aggregators.Aggregate((ulong) 0,
                                                                            (sum, methodAgr) =>
                                                                            sum + methodAgr.CycleTime);

            CreateMethodByMetadataDictionary();
            // InterconnectMethodCalls(aggregators);
            CreateCriteriaContext();
            PopulateSourceFiles();
        }
        public TracingCallTreeConvertor(IEnumerable <TracingCallTree> tracingCallTrees)
        {
            _globalAggregatedValues = new TracingGlobalAggregatedValues();

            var flattenedTreeList = new List <TracingCallTreeElem>();

            foreach (TracingCallTree callTree in tracingCallTrees)
            {
                _globalAggregatedValues.TotalActiveTime += callTree.UserModeDurationHns + callTree.KernelModeDurationHns;
                FlattenCallTree(callTree.RootElem, flattenedTreeList);
            }

            _aggregators = flattenedTreeList.GroupBy(
                elem => elem.MethodMetadata).Select(
                grouping =>
            {
                MethodMetadata methodMetadata = grouping.Key;
                var aggregator = new TracingMethodAggregator(methodMetadata);
                aggregator.AggregateRange(grouping);
                return(aggregator);
            });


            _globalAggregatedValues.TotalCycleTime = _aggregators.Aggregate((ulong)0,
                                                                            (sum, methodAgr) =>
                                                                            sum + methodAgr.CycleTime);

            CreateMethodByMetadataDictionary();
            // InterconnectMethodCalls(aggregators);
            CreateCriteriaContext();
            PopulateSourceFiles();
        }