RecordedValues() public method

Provide a means of iterating through all recorded histogram values using the finest granularity steps supported by the underlying representation. The iteration steps through all non-zero recorded value counts, and terminates when all recorded histogram values are exhausted.
public RecordedValues ( ) : IEnumerable
return IEnumerable
Exemplo n.º 1
0
 /// <summary>
 /// Add the contents of another histogram to this one, while correcting the incoming data for coordinated omission.
 /// </summary>
 /// <param name="fromHistogram">The other histogram. highestTrackableValue and largestValueWithSingleUnitResolution must match.</param>
 /// <param name="expectedIntervalBetweenValueSamples">If <paramref name="expectedIntervalBetweenValueSamples"/> is larger than 0, add auto-generated value records as appropriate if value is larger than <paramref name="expectedIntervalBetweenValueSamples"/></param>
 /// <remarks>
 /// To compensate for the loss of sampled values when a recorded value is larger than the expected interval between value samples, the values added will include an auto-generated additional series of decreasingly-smaller(down to the expectedIntervalBetweenValueSamples) value records for each count found in the current histogram that is larger than the expectedIntervalBetweenValueSamples.
 ///
 /// Note: This is a post-recording correction method, as opposed to the at-recording correction method provided by {@link #recordValueWithExpectedInterval(long, long) recordValueWithExpectedInterval}.
 /// The two methods are mutually exclusive, and only one of the two should be be used on a given data set to correct for the same coordinated omission issue.
 /// See notes in the description of the Histogram calls for an illustration of why this corrective behavior is important.
 /// </remarks>
 /// <exception cref="System.IndexOutOfRangeException">if values exceed highestTrackableValue.</exception>
 public void AddWhileCorrectingForCoordinatedOmission(HistogramBase fromHistogram, long expectedIntervalBetweenValueSamples)
 {
     foreach (var v in fromHistogram.RecordedValues())
     {
         RecordValueWithCountAndExpectedInterval(
             v.ValueIteratedTo,
             v.CountAtValueIteratedTo,
             expectedIntervalBetweenValueSamples);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Get the computed standard deviation of all recorded values in the histogram
        /// </summary>
        /// <returns>the standard deviation (in value units) of the histogram data</returns>
        public static double GetStdDeviation(this HistogramBase histogram)
        {
            var mean = histogram.GetMean();
            var geometricDeviationTotal = 0.0;

            foreach (var iterationValue in histogram.RecordedValues())
            {
                double deviation = (histogram.MedianEquivalentValue(iterationValue.ValueIteratedTo) * 1.0) - mean;
                geometricDeviationTotal += (deviation * deviation) * iterationValue.CountAddedInThisIterationStep;
            }
            var stdDeviation = Math.Sqrt(geometricDeviationTotal / histogram.TotalCount);

            return(stdDeviation);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get the computed mean value of all recorded values in the histogram
        /// </summary>
        /// <returns>the mean value (in value units) of the histogram data</returns>
        public static double GetMean(this HistogramBase histogram)
        {
            var totalValue = histogram.RecordedValues().Select(hiv => hiv.TotalValueToThisValue).LastOrDefault();

            return((totalValue * 1.0) / histogram.TotalCount);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Get the highest recorded value level in the histogram
        /// </summary>
        /// <returns>the Max value recorded in the histogram</returns>
        public static long GetMaxValue(this HistogramBase histogram)
        {
            var max = histogram.RecordedValues().Select(hiv => hiv.ValueIteratedTo).LastOrDefault();

            return(histogram.HighestEquivalentValue(max));
        }
Exemplo n.º 5
0
 /// <summary>
 /// Add the contents of another histogram to this one, while correcting the incoming data for coordinated omission.
 /// </summary>
 /// <param name="fromHistogram">The other histogram. highestTrackableValue and largestValueWithSingleUnitResolution must match.</param>
 /// <param name="expectedIntervalBetweenValueSamples">If <paramref name="expectedIntervalBetweenValueSamples"/> is larger than 0, add auto-generated value records as appropriate if value is larger than <paramref name="expectedIntervalBetweenValueSamples"/></param>
 /// <remarks>
 /// To compensate for the loss of sampled values when a recorded value is larger than the expected interval between value samples, the values added will include an auto-generated additional series of decreasingly-smaller(down to the expectedIntervalBetweenValueSamples) value records for each count found in the current histogram that is larger than the expectedIntervalBetweenValueSamples.
 /// 
 /// Note: This is a post-recording correction method, as opposed to the at-recording correction method provided by {@link #recordValueWithExpectedInterval(long, long) recordValueWithExpectedInterval}. 
 /// The two methods are mutually exclusive, and only one of the two should be be used on a given data set to correct for the same coordinated omission issue.
 /// See notes in the description of the Histogram calls for an illustration of why this corrective behavior is important.
 /// </remarks>
 /// <exception cref="System.IndexOutOfRangeException">if values exceed highestTrackableValue.</exception>
 public void AddWhileCorrectingForCoordinatedOmission(HistogramBase fromHistogram, long expectedIntervalBetweenValueSamples)
 {
     foreach (var v in fromHistogram.RecordedValues())
     {
         RecordValueWithCountAndExpectedInterval(
             v.ValueIteratedTo,
             v.CountAtValueIteratedTo,
             expectedIntervalBetweenValueSamples);
     }
 }
        /// <summary>
        /// Get the lowest recorded value level in the histogram
        /// </summary>
        /// <returns>the Min value recorded in the histogram</returns>
        public static long GetMinValue(this HistogramBase histogram)
        {
            var min = histogram.RecordedValues().Select(hiv => hiv.ValueIteratedTo).FirstOrDefault();

            return(histogram.LowestEquivalentValue(min));
        }