Inheritance: IInboundPerfomanceCounters
Beispiel #1
0
        private static void CreateInboundCategory()
        {
            if (PerformanceCounterCategory.Exists(InboundPerfomanceCounters.CATEGORY))
            {
                logger.DebugFormat("Deleting existing performance counter category '{0}'.", InboundPerfomanceCounters.CATEGORY);
                PerformanceCounterCategory.Delete(InboundPerfomanceCounters.CATEGORY);
            }

            logger.DebugFormat("Creating performance counter category '{0}'.", InboundPerfomanceCounters.CATEGORY);

            try
            {
                var counters = new CounterCreationDataCollection(InboundPerfomanceCounters.SupportedCounters().ToArray());
                PerformanceCounterCategory.Create(
                    InboundPerfomanceCounters.CATEGORY,
                    "Provides statistics for Rhino-Queues messages in-bound to queues on the current machine.",
                    PerformanceCounterCategoryType.MultiInstance,
                    counters);
            }
            catch (Exception ex)
            {
                logger.Error("Creation of inbound counters failed.", ex);
                throw;
            }
        }
 public IInboundPerfomanceCounters GetInboundCounters(string instanceName)
 {
     IInboundPerfomanceCounters counter;
     if (!inboundCounters.TryGetValue(instanceName, out counter))
     {
         lock (outboundCounters)
         {
             if (!inboundCounters.TryGetValue(instanceName, out counter))
             {
                 counter = new InboundPerfomanceCounters(instanceName);
                 inboundCounters.Add(instanceName, counter);
             }
         }
     }
     return counter;
 }
Beispiel #3
0
        public IInboundPerfomanceCounters GetInboundCounters(string instanceName)
        {
            IInboundPerfomanceCounters counter;

            if (!inboundCounters.TryGetValue(instanceName, out counter))
            {
                lock (outboundCounters)
                {
                    if (!inboundCounters.TryGetValue(instanceName, out counter))
                    {
                        counter = new InboundPerfomanceCounters(instanceName);
                        inboundCounters.Add(instanceName, counter);
                    }
                }
            }
            return(counter);
        }
Beispiel #4
0
 protected virtual void AssertCountersExist()
 {
     OutboundPerfomanceCounters.AssertCountersExist();
     InboundPerfomanceCounters.AssertCountersExist();
 }