예제 #1
0
 private static double AverageTime(Measurements[] measurements, int discardedPercent = 0)
 {
     if (measurements == null || measurements.Length == 0) return 0;
     return BottomPercent(measurements, discardedPercent).Average(m => m.Time);
 }
예제 #2
0
 private static IEnumerable<Measurements> BottomPercent(Measurements[] measurements, int discardedPercent)
 {
     if (discardedPercent == 0) return measurements;
     var take = (int) Math.Round(measurements.Length*(100 - discardedPercent)/100.0);
     return measurements.OrderBy(m => m.Time).Take(take);
 }
예제 #3
0
 private static double P99Time(Measurements[] measurements)
 {
     if (measurements == null || measurements.Length == 0) return 0;
     return BottomPercent(measurements, 1).Select(m => m.Time).LastOrDefault();
 }
예제 #4
0
 private static double MinTime(Measurements[] measurements)
 {
     if (measurements == null || measurements.Length == 0) return 0;
     return measurements.Min(m => m.Time);
 }
예제 #5
0
 private static int AverageSize(Measurements[] measurements)
 {
     if (measurements == null || measurements.Length == 0) return 0;
     return (int) measurements.Average(m => m.Size);
 }