Beispiel #1
0
        private double GetLargeLatencyPercentage(IDictionary <string, long> data, long latencyMax)
        {
            var largeLatencyMessageCount = data[SignalRUtils.MessageGreaterOrEqualTo(latencyMax)];
            var receivedMessageCount     = data[SignalRConstants.StatisticsMessageReceived];

            return((double)largeLatencyMessageCount / receivedMessageCount);
        }
        public void RecordLatency(long latency)
        {
            var index      = latency / LatencyStep;
            var upperBound = (index + 1) * LatencyStep;

            if (upperBound <= LatencyMax)
            {
                _statistics.AddOrUpdate(SignalRUtils.MessageLessThan(upperBound), 1, (k, v) => v + 1);
            }
            else
            {
                _statistics.AddOrUpdate(SignalRUtils.MessageGreaterOrEqualTo(LatencyMax), 1, (k, v) => v + 1);
            }
        }