Inheritance: IOutboundPerfomanceCounters
Ejemplo n.º 1
0
        private static void CreateOutboundCategory()
        {
            if (PerformanceCounterCategory.Exists(OutboundPerfomanceCounters.CATEGORY))
            {
                logger.DebugFormat("Deleting existing performance counter category '{0}'.", OutboundPerfomanceCounters.CATEGORY);
                PerformanceCounterCategory.Delete(OutboundPerfomanceCounters.CATEGORY);
            }

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

            try
            {
                var counters = new CounterCreationDataCollection(OutboundPerfomanceCounters.SupportedCounters().ToArray());
                PerformanceCounterCategory.Create(
                    OutboundPerfomanceCounters.CATEGORY,
                    "Provides statistics for Rhino-Queues messages out-bound from the current machine.",
                    PerformanceCounterCategoryType.MultiInstance,
                    counters);
            }
            catch (Exception ex)
            {
                logger.Error("Creation of outbound counters failed.", ex);
                throw;
            }
        }
 public IOutboundPerfomanceCounters GetOutboundCounters(string instanceName)
 {
     IOutboundPerfomanceCounters counter;
     if (!outboundCounters.TryGetValue(instanceName, out counter))
     {
         lock (outboundCounters)
         {
             if (!outboundCounters.TryGetValue(instanceName, out counter))
             {
                 counter = new OutboundPerfomanceCounters(instanceName);
                 outboundCounters.Add(instanceName, counter);
             }
         }
     }
     return counter;
 }
Ejemplo n.º 3
0
        public IOutboundPerfomanceCounters GetOutboundCounters(string instanceName)
        {
            IOutboundPerfomanceCounters counter;

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