Exemplo n.º 1
0
        public static PerformanceStatisticsForPage Calculate(int[] distribution, string pageName)
        {
            if (distribution.Length == 0)
            {
                return(new PerformanceStatisticsForPage {
                    PageName = pageName
                });
            }
            var res = new PerformanceStatisticsForPage {
                Count    = distribution.Length,
                Mean     = (int)distribution.Average(),
                Median   = new QuickSelect().Select(distribution, (int)(0.5 * distribution.Length)),
                PageName = pageName,
            };

            res.Sum = res.Count * res.Mean;

            return(res);
        }
Exemplo n.º 2
0
 public PerformanceStatisticsForPageCollection(PerformanceStatisticsForPage[] pageStatistics, PerformanceStatisticsForPage preCalculatedStatisticsForAllPages)
 {
     _pageStatistics        = pageStatistics;
     _statisticsForAllPages = preCalculatedStatisticsForAllPages;
 }