示例#1
0
 /// <summary>
 /// Creates a recorder that will delegate recording to histograms created from these parameters.
 /// </summary>
 /// <param name="lowestDiscernibleValue">The lowest value that can be tracked (distinguished from 0) by the histogram.
 /// Must be a positive integer that is &gt;= 1.
 /// May be internally rounded down to nearest power of 2.
 /// </param>
 /// <param name="highestTrackableValue">The highest value to be tracked by the histogram.
 /// Must be a positive integer that is &gt;= (2 * lowestTrackableValue).
 /// </param>
 /// <param name="numberOfSignificantValueDigits">
 /// The number of significant decimal digits to which the histogram will maintain value resolution and separation.
 /// Must be a non-negative integer between 0 and 5.
 /// </param>
 /// <param name="histogramFactory">The factory to be used to actually create instances of <seealso cref="HistogramBase"/>.</param>
 public Recorder(
     long lowestDiscernibleValue,
     long highestTrackableValue,
     int numberOfSignificantValueDigits,
     HistogramFactoryDelegate histogramFactory)
 {
     _histogramFactory  = histogramFactory;
     _activeHistogram   = histogramFactory(_instanceId, lowestDiscernibleValue, highestTrackableValue, numberOfSignificantValueDigits);
     _inactiveHistogram = histogramFactory(_instanceId, lowestDiscernibleValue, highestTrackableValue, numberOfSignificantValueDigits);
     _activeHistogram.StartTimeStamp = DateTime.Now.MillisecondsSinceUnixEpoch();
 }
示例#2
0
 /// <summary>
 /// Creates a recorder that will delegate recording to histograms created from these parameters.
 /// </summary>
 /// <param name="lowestDiscernibleValue">The lowest value that can be tracked (distinguished from 0) by the histogram.
 /// Must be a positive integer that is &gt;= 1.
 /// May be internally rounded down to nearest power of 2.
 /// </param>
 /// <param name="highestTrackableValue">The highest value to be tracked by the histogram.
 /// Must be a positive integer that is &gt;= (2 * lowestTrackableValue).
 /// </param>
 /// <param name="numberOfSignificantValueDigits">
 /// The number of significant decimal digits to which the histogram will maintain value resolution and separation. 
 /// Must be a non-negative integer between 0 and 5.
 /// </param>
 /// <param name="histogramFactory">The factory to be used to actually create instances of <seealso cref="HistogramBase"/>.</param>
 public Recorder(
     long lowestDiscernibleValue,
     long highestTrackableValue,
     int numberOfSignificantValueDigits,
     HistogramFactoryDelegate histogramFactory)
 {
     _histogramFactory = histogramFactory;
     _activeHistogram = histogramFactory(_instanceId, lowestDiscernibleValue, highestTrackableValue, numberOfSignificantValueDigits);
     _inactiveHistogram = histogramFactory(_instanceId, lowestDiscernibleValue, highestTrackableValue, numberOfSignificantValueDigits);
     _activeHistogram.StartTimeStamp = DateTime.Now.MillisecondsSinceUnixEpoch();
 }