Inheritance: MassTransit.Monitoring.Performance.PerformanceCounters
        public MessagePerformanceCounter()
        {
            string messageType = TypeMetadataCache <TMessage> .ShortName;

            if (messageType.Length > 127)
            {
                messageType = messageType.Substring(messageType.Length - 127);
            }

            _totalConsumed = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.TotalReceived.CounterName, messageType);
            _consumedPerSecond = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.ConsumedPerSecond.CounterName, messageType);
            _consumeDuration = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.ConsumeDuration.CounterName, messageType);
            _consumeDurationBase = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.ConsumeDurationBase.CounterName, messageType);
            _faulted = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.ConsumeFaulted.CounterName, messageType);
            _faultPercentage = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.ConsumeFaultPercentage.CounterName, messageType);
            _faultPercentageBase = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.ConsumeFaultPercentageBase.CounterName, messageType);
            _totalSent = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.TotalSent.CounterName, messageType);
            _sentPerSecond = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.SentPerSecond.CounterName, messageType);
            _sendFaulted = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.SendFaulted.CounterName, messageType);
            _sendFaultPercentage = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.SendFaultPercentage.CounterName, messageType);
            _sendFaultPercentageBase = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.SendFaultPercentageBase.CounterName, messageType);
            _totalPublished = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.TotalPublished.CounterName, messageType);
            _publishedPerSecond = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.PublishedPerSecond.CounterName, messageType);
            _publishFaulted = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.PublishFaulted.CounterName, messageType);
            _publishFaultPercentage = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.PublishFaultPercentage.CounterName, messageType);
            _publishFaultPercentageBase = MessagePerformanceCounters.CreateCounter(
                MessagePerformanceCounters.PublishFaultPercentageBase.CounterName, messageType);
        }
Beispiel #2
0
 public static void Install()
 {
     MessagePerformanceCounters value = Cached.Instance.Value;
 }