Beispiel #1
0
        public static IDataBreakout[] GetBreakouts(TimeSpan[] input)
        {
            if (input.Length == 0)
            {
                return(new IDataBreakout[0]);
            }

            var min = input.Min(m => m.Ticks);
            var max = input.Max(m => m.Ticks);
            var countOfBreakouts = Math.Min((input.Count() / 5), 8);

            if (countOfBreakouts < 1)
            {
                countOfBreakouts = 1;
            }


            var width = ((max - min) + 1) / countOfBreakouts;
            var l     = new List <IDataBreakout>();

            for (var i = 0; i < countOfBreakouts; i++)
            {
                var rMin = min + (width * i);
                var rMax = (i + 1 == countOfBreakouts) ? max : min + (width * (i + 1));
                var line = new DataBreakout
                {
                    RangeMaxValue = TimeSpan.FromTicks(rMax),
                    RangeMinValue = TimeSpan.FromTicks(rMin)
                };
                line.Occurences = input.Count(m => m <= line.RangeMaxValue && m >= line.RangeMinValue);
                l.Add(line);
            }
            return(l.ToArray());
        }
Beispiel #2
0
 public IDataBreakout[] GetBreakout()
 {
     return(DataBreakout.GetBreakouts(_testPasses.Select(m => m.ExecutionTime).ToArray()));
 }