public void ShouldComputeBenchmarkStat(long[] values, double max, double min, double average, double stdDev)
 {
     var benchmarkStat = new BenchmarkStat(values);
     Assert.Equal(max, benchmarkStat.Max);
     Assert.Equal(min, benchmarkStat.Min);
     Assert.Equal(average, benchmarkStat.Average);
     Assert.Equal(stdDev, benchmarkStat.StandardDeviation);
 }
        public AggregateMetrics(MetricName name, string unit, IReadOnlyList<MetricRunReport> runs)
        {
            Contract.Requires(runs != null);
            Contract.Requires(name != null);
            Contract.Requires(!string.IsNullOrEmpty(unit));
            Name = name;
            Unit = unit;
            Runs = runs == null || runs.Count == 0 ? GetSafeRuns(name, unit) : runs;

            Stats = new BenchmarkStat(runs.Select(x => x.MetricValue));
            PerSecondStats = new BenchmarkStat(runs.Select(x => x.MetricValuePerSecond));
        }
Exemple #3
0
        public AggregateMetrics(MetricName name, string unit, IReadOnlyList <MetricRunReport> runs)
        {
            Contract.Requires(runs != null);
            Contract.Requires(name != null);
            Contract.Requires(!string.IsNullOrEmpty(unit));
            Name = name;
            Unit = unit;
            Runs = runs == null || runs.Count == 0 ? GetSafeRuns(name, unit) : runs;

            Stats          = new BenchmarkStat(runs.Select(x => x.MetricValue));
            PerSecondStats = new BenchmarkStat(runs.Select(x => x.MetricValuePerSecond));
        }