示例#1
0
        public ReaderStatistics Reset()
        {
            Stopwatch        prevWatch = Interlocked.Exchange(ref stopwatch, Stopwatch.StartNew());
            ReaderStatistics prevStats = Interlocked.Exchange(ref stats, new ReaderStatistics());
            var prevPoints             = Interlocked.Exchange(ref dataPoints, new List <double>());

            prevStats.Interval = prevWatch.Elapsed;
            if (prevPoints.Count > 0)
            {
                prevStats.NintyPercentileE2ELatency = prevPoints[(int)(prevPoints.Count * 0.9)];
            }
            return(prevStats);
        }
示例#2
0
 public StatisticsTracker()
 {
     stats      = new ReaderStatistics();
     dataPoints = new List <double>();
     stopwatch  = Stopwatch.StartNew();
 }