/// <summary>
        /// Build memory profiling statistics for a selected time frame [the time frame is not used currently].
        /// </summary>
        /// <param name="timeFrame">The selected time frame (specifies a time range)</param>
        public void BuildStatistics(SelectedTimeFrame selectedTimeframe)
        {
            DataTypeAllocationStatistics.Clear();

            DataTypeMemoryStatistics.Clear();

            foreach (var sr in CombinedGarbageCollectorSamples)
            {
                var name = DataTypes[sr.Key];
                var list = sr.Value;
                DataTypeMemoryStatistics.Add(sr.Key, new DataTypeMemoryStatistics
                {
                    DataTypeId      = sr.Key,
                    DataTypeName    = name,
                    ObjectsCountMax = list.Max(sample => sample.ObjectsCount),
                    ObjectsCountAvg = Math.Round(list.Average(sample => (double)sample.ObjectsCount)),
                    MemorySizeMax   = list.Max(sample => sample.MemorySize),
                    MemorySizeAvg   = Math.Round(list.Average(sample => (double)sample.MemorySize)),
                });
            }

            foreach (var sr in _cperfContainer.DataTypeAllocations)
            {
                var name = DataTypes[sr.Key];
                var list = sr.Value;
                DataTypeAllocationStatistics.Add(sr.Key, new DataTypeAllocationStatistics
                {
                    DataTypeName = name,
                    MemorySize   = (ulong)list.Sum(sample => (double)sample.MemorySize),
                    ObjectsCount = (ulong)list.Sum(sample => (double)sample.ObjectsCount),
                });
            }
        }
Beispiel #2
0
        protected bool Equals(SelectedTimeFrame other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Start == other.Start && End == other.End);
        }