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; }
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); }
protected virtual void AssertCountersExist() { OutboundPerfomanceCounters.AssertCountersExist(); InboundPerfomanceCounters.AssertCountersExist(); }