コード例 #1
0
 public LatencyStepQueueEventProcessor(FunctionStep functionStep,
                             BlockingCollection<long> inputQueue,
                             BlockingCollection<long> outputQueue,
                             Histogram histogram, long nanoTimeCost, double ticksToNanos, long iterations)
 {
     _functionStep = functionStep;
     _inputQueue = inputQueue;
     _outputQueue = outputQueue;
     _histogram = histogram;
     _nanoTimeCost = nanoTimeCost;
     _ticksToNanos = ticksToNanos;
     _iterations = iterations;
 }
コード例 #2
0
        /// <summary>
        /// Add observations from another Histogram into this one.
        /// Histograms must have the same intervals.
        /// </summary>
        /// <param name="histogram">histogram from which to add the observation counts.</param>
        public void AddObservations(Histogram histogram)
        {
            if (_upperBounds.Length != histogram._upperBounds.Length)
            {
                throw new ArgumentException("Histograms must have matching intervals", "histogram");
            }

            for (int i = 0; i < _upperBounds.Length; i++)
            {
                if (_upperBounds[i] != histogram._upperBounds[i])
                {
                    throw new ArgumentException("Histograms must have matching intervals", "histogram");
                }
            }

            for (int i = 0; i < _counts.Length; i++)
            {
                _counts[i] += histogram._counts[i];
            }

            TrackRange(histogram._minValue);
            TrackRange(histogram._maxValue);
        }
コード例 #3
0
 protected LatencyPerfTest(int iterations, Histogram histogram)
     : base(iterations)
 {
     Histogram = histogram;
     StopwatchTimestampCostInNano = InitStopwatchTimestampCostInNano();
 }