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); }
public PerformanceStatisticsForPageCollection(PerformanceStatisticsForPage[] pageStatistics, PerformanceStatisticsForPage preCalculatedStatisticsForAllPages) { _pageStatistics = pageStatistics; _statisticsForAllPages = preCalculatedStatisticsForAllPages; }