示例#1
0
        public void RecordMessageReceivedMetric(Message message, int bytesReceived)
        {
            PayloadTypeMetric metric = this.GetPayloadTypeMetric(message.Payload);

            lock (this.locker)
            {
                metric.ReceivedCount++;
                metric.BytesReceivedCount += bytesReceived;
            }
        }
示例#2
0
        public void RecordMessageSentMetric(Message message, int bytesSent)
        {
            PayloadTypeMetric metric = this.GetPayloadTypeMetric(message.Payload);

            lock (this.locker)
            {
                metric.SentCount++;
                metric.BytesSentCount += bytesSent;
            }
        }
示例#3
0
        public PayloadTypeMetric GetPayloadTypeMetric(Type type)
        {
            lock (this.locker)
            {
                if (!this.payloadTypeMetrics.TryGetValue(type, out PayloadTypeMetric metric))
                {
                    metric = new PayloadTypeMetric();

                    this.payloadTypeMetrics[type] = metric;
                }

                return(metric);
            }
        }