Example #1
0
        public static void IncrementExceptionPerSec(Uri endpoint, int count, Exception exception)
        {
            if (exception == null)
            {
                return;
            }
            MessagingPerformanceCounters counter = MessagingPerformanceCounters.GetCounter(endpoint.Host);

            if (!counter.Initialized)
            {
                return;
            }
            counter.counters[24].IncrementBy((long)count);
            counter.counters[25].IncrementBy((long)count);
            if (exception is ServerBusyException)
            {
                counter.counters[28].IncrementBy((long)count);
                return;
            }
            if (exception is MessagingCommunicationException)
            {
                counter.counters[27].IncrementBy((long)count);
                return;
            }
            if (exception is MessagingException)
            {
                counter.counters[26].IncrementBy((long)count);
            }
        }
Example #2
0
        public static void IncrementTokensAcquiredPerSec(Uri endpoint, int count)
        {
            MessagingPerformanceCounters counter = MessagingPerformanceCounters.GetCounter(endpoint.Host);

            if (!counter.Initialized)
            {
                return;
            }
            counter.counters[30].IncrementBy((long)count);
        }
Example #3
0
        public static void IncrementPendingReceiveMessageCount(Uri endpoint, int count)
        {
            MessagingPerformanceCounters counter = MessagingPerformanceCounters.GetCounter(endpoint.Host);

            if (!counter.Initialized)
            {
                return;
            }
            counter.counters[34].IncrementBy((long)count);
        }
Example #4
0
        public static void IncrementPendingAcceptMessageSessionByNamespaceCount(Uri endpoint, int count)
        {
            MessagingPerformanceCounters counter = MessagingPerformanceCounters.GetCounter(endpoint.Host);

            if (!counter.Initialized)
            {
                return;
            }
            counter.counters[36].IncrementBy((long)count);
        }
Example #5
0
        public static void IncrementMessagingFactoryCount(Uri endpoint, int count)
        {
            MessagingPerformanceCounters counter = MessagingPerformanceCounters.GetCounter(endpoint.Host);

            if (!counter.Initialized)
            {
                return;
            }
            counter.counters[29].IncrementBy((long)count);
        }
Example #6
0
        public static void IncrementTokenAcquisitionLatency(Uri endpoint, long ticks)
        {
            MessagingPerformanceCounters counter = MessagingPerformanceCounters.GetCounter(endpoint.Host);

            if (!counter.Initialized)
            {
                return;
            }
            counter.counters[33].IncrementBy(ticks);
            counter.counters[32].Increment();
        }
Example #7
0
        public static void IncrementSendMessageSuccessPerSec(Uri endpoint, int count)
        {
            MessagingPerformanceCounters counter = MessagingPerformanceCounters.GetCounter(endpoint.Host);

            if (!counter.Initialized)
            {
                return;
            }
            counter.counters[0].IncrementBy((long)count);
            counter.counters[1].IncrementBy((long)count);
        }
Example #8
0
        public static void IncrementSendMessageLatency(Uri endpoint, long ticks)
        {
            MessagingPerformanceCounters counter = MessagingPerformanceCounters.GetCounter(endpoint.Host);

            if (!counter.Initialized)
            {
                return;
            }
            counter.counters[5].IncrementBy(ticks);
            counter.counters[4].Increment();
        }
Example #9
0
        public static void IncrementReceiveMessageFailurePerSec(Uri endpoint, int count)
        {
            MessagingPerformanceCounters counter = MessagingPerformanceCounters.GetCounter(endpoint.Host);

            if (!counter.Initialized)
            {
                return;
            }
            counter.counters[8].IncrementBy((long)count);
            counter.counters[9].IncrementBy((long)count);
        }
Example #10
0
        public static void IncrementAcceptMessageSessionByNamespaceLatency(Uri endpoint, long ticks)
        {
            MessagingPerformanceCounters counter = MessagingPerformanceCounters.GetCounter(endpoint.Host);

            if (!counter.Initialized)
            {
                return;
            }
            counter.counters[23].IncrementBy(ticks);
            counter.counters[22].Increment();
        }
Example #11
0
        public static MessagingPerformanceCounters GetCounter(string name)
        {
            MessagingPerformanceCounters messagingPerformanceCounter;
            MessagingPerformanceCounters messagingPerformanceCounter1;

            lock (MessagingPerformanceCounters.staticSyncRoot)
            {
                if (!MessagingPerformanceCounters.performanceCounters.TryGetValue(name, out messagingPerformanceCounter))
                {
                    messagingPerformanceCounter = new MessagingPerformanceCounters(name);
                    MessagingPerformanceCounters.performanceCounters.Add(name, messagingPerformanceCounter);
                }
                messagingPerformanceCounter1 = messagingPerformanceCounter;
            }
            return(messagingPerformanceCounter1);
        }
Example #12
0
 protected override void OnInitialize()
 {
     lock (MessagingPerformanceCounters.staticSyncRoot)
     {
         if (MessagingPerformanceCounters.counterSet == null)
         {
             CounterSet counterSet = MessagingPerformanceCounters.CreateCounterSet();
             foreach (KeyValuePair <MessagingPerformanceCounters.MessagingPerfCounterKeys, MessagingPerformanceCounters.CounterMetadata> perfCounterDictionary in MessagingPerformanceCounters.PerfCounterDictionary)
             {
                 counterSet.AddCounter(perfCounterDictionary.Value.Id, perfCounterDictionary.Value.Type, perfCounterDictionary.Value.Name);
             }
             MessagingPerformanceCounters.counterSet = counterSet;
         }
     }
     this.counterSetInstance = MessagingPerformanceCounters.CreateCounterSetInstance(this.InstanceName);
     this.counters           = new CounterData[43];
     for (int i = 0; i < (int)this.counters.Length; i++)
     {
         this.counters[i]       = this.counterSetInstance.Counters[i];
         this.counters[i].Value = (long)0;
     }
 }