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