Example #1
0
        public void GetFrameGroupData(int fromFrameIdx, int toFrameIdx, String[] groups, GroupsStats stats)
        {
            for (int i = fromFrameIdx; i <= toFrameIdx; i++)
            {
                FrameRecord fr = FrameRecords[i];

                foreach (string key in fr.Values.Paths)
                {
                    foreach (string group in groups)
                    {
                        if (key.Contains(group))
                        {
                            if (stats.m_groupStats.Count == 0 || !stats.ContainsGroup(group))
                            {
                                stats.m_groupStats.Add(group, new GroupItemStats());
                            }

                            GroupItemStats groupItemStats = stats.GetGroupItemsStats(group);

                            string itemKey = key.Substring(key.LastIndexOf('/') + 1);

                            if (!groupItemStats.ContainsItem(itemKey))
                            {
                                groupItemStats.m_groupItemStats.Add(itemKey, new Stats());
                            }

                            Stats itemStats = groupItemStats.GetItemStats(itemKey);
                            itemStats.m_min  = Math.Min(itemStats.m_min, fr.Values[key]);
                            itemStats.m_max  = Math.Max(itemStats.m_max, fr.Values[key]);
                            itemStats.m_avg += fr.Values[key];
                        }
                    }
                }
            }

            foreach (string group in stats.m_groupStats.Keys)
            {
                foreach (string item in stats.GetGroupItemsStats(group).m_groupItemStats.Keys)
                {
                    Stats itemStats = stats.GetGroupItemsStats(group).GetItemStats(item);
                    itemStats.m_avg /= (toFrameIdx - fromFrameIdx + 1);
                }
            }
        }