public void Calculate()
        {
            Results.Add(new BuildStabilityMetric
            {
                Date               = Date,
                FailureRate        = CalculateFailureRateFor(Builds),
                RecoveryTime       = CalculateAverageRecoveryTimeInHoursFor(Intervals),
                RecoveryTimeStdDev = Calculator.ConvertMillisecondsToHours(
                    Calculator.CalculateStandardDeviation(Intervals)),
                IgnoredTestCount = Builds.Sum(build => build.IgnoredTestCount)
            });

            Intervals.Clear();
            Builds.Clear();
        }
        public void Calculate()
        {
            Results.Add(new BuildDeploymentMetric
            {
                Date               = Date,
                IntervalTime       = CalculateAverageTimeInDaysFor(Intervals),
                IntervalTimeStdDev =
                    Calculator.ConvertMillisecondsToDays(
                        Calculator.CalculateStandardDeviation(Intervals)),
                DurationTime       = CalculateAverageTimeInHoursFor(Durations),
                DurationTimeStdDev =
                    Calculator.ConvertMillisecondsToHours(
                        Calculator.CalculateStandardDeviation(Durations))
            });

            Intervals.Clear();
            Durations.Clear();
        }
Пример #3
0
        public void SortAndCollapse()
        {
            // collapse any overlaps
            var doCollapse        = true;
            var scrubbedIntervals = new List <Region>();

            while (doCollapse)
            {
                scrubbedIntervals.Clear();
                doCollapse = false;

                foreach (var interval in Intervals)
                {
                    var existingOverlap = scrubbedIntervals.FirstOrDefault(i => i.Overlaps(interval));

                    if (existingOverlap != null)
                    {
                        var union = existingOverlap.Merge(interval);
                        if (!scrubbedIntervals.Contains(union))
                        {
                            scrubbedIntervals.Remove(existingOverlap);
                            scrubbedIntervals.Add(union);
                            doCollapse = true; // go for another round of merging
                        }
                    }
                    else
                    {
                        scrubbedIntervals.Add(interval);
                    }
                }

                Intervals.Clear();
                Intervals.AddRange(scrubbedIntervals);
            }

            Intervals.Sort((i1, i2) => i1.StartPosition.CompareTo(i2.StartPosition));
        }
Пример #4
0
 public void ClearData()
 {
     LoggedData.Clear();
     Intervals.Clear();
     Timestamps.Clear();
 }
Пример #5
0
 public new void Clear()
 {
     Intervals.Clear();
     _LastInterval = null;
     _Count        = -1;
 }
Пример #6
0
 public void Reset()
 {
     Intervals.Clear();
     Start();
 }
Пример #7
0
 public void Stop()
 {
     Intervals.Clear();
 }