public Statistics CalculateAndReset()
        {
            var stats = new Statistics();

            lock (_histogramLock)
            {
                stats.RenderedCount = _uiLatency.Count;
                stats.ReceivedCount = _serverLatency.Count;
                stats.ServerLatencyMax = _serverLatency.Max;
                stats.UiLatencyMax = _uiLatency.Max;
                stats.TotalLatencyMax = _combinedLatency.Max;
                stats.Histogram = _combinedLatency.ToString();

                _uiLatency.Clear();
                _combinedLatency.Clear();
                _serverLatency.Clear();
            }

            return stats;
        }
        public Statistics CalculateAndReset()
        {
            var stats = new Statistics();

            lock (_histogramLock)
            {
                stats.RenderedCount = _uiLatency.Count;
                stats.ReceivedCount = _serverLatency.Count;
                stats.ServerLatencyMax = _serverLatency.Max;
                stats.UiLatencyMax = _uiLatency.Max;
                stats.TotalLatencyMax = _combinedLatency.Max;
                stats.Histogram = _combinedLatency.ToString();

            //    var currentProcessTime = _currentProcess.UserProcessorTime;
            //    stats.ProcessTime = currentProcessTime.Subtract(_lastProcessTime);
               // _lastProcessTime = currentProcessTime;

                _uiLatency.Clear();
                _combinedLatency.Clear();
                _serverLatency.Clear();
            }

            return stats;
        }