Ejemplo n.º 1
0
        public static SummaryExecutionMap Summarize(IEnumerable <ExecutionMap> maps)
        {
            SummaryExecutionMap result    = new SummaryExecutionMap();
            HashSet <string>    perfDatas = new HashSet <string>();

            foreach (ExecutionMap map in maps)
            {
                foreach (KeyValuePair <string, TimingData> pair in map.Map)
                {
                    if (!perfDatas.Contains(pair.Key))
                    {
                        perfDatas.Add(pair.Key);
                    }
                }
            }
            foreach (string perfData in perfDatas)
            {
                TimeSpan summaryTime = new TimeSpan();
                string   parentName  = String.Empty;
                foreach (ExecutionMap executionMap in maps)
                {
                    if (executionMap.Map.ContainsKey(perfData))
                    {
                        TimingData pData = executionMap.Map[perfData];
                        summaryTime += pData.AccumulatedSpan;
                        parentName   = pData.ParentName;
                    }
                }
                result.SumMap[perfData] = new SummaryPerformanceData()
                {
                    SummarySpan = summaryTime,
                    Name        = perfData,
                    ParentName  = parentName
                };
            }
            return(result);
        }
Ejemplo n.º 2
0
 private static SummaryExecutionMap SummarizeExecutionMaps(IEnumerable <ExecutionMap> maps)
 {
     return(SummaryExecutionMap.Summarize(maps));
 }