//------------------------------------------------------------------------------ // // Method: PerformanceCounterMetricLoggerImplementation (constructor) // //------------------------------------------------------------------------------ /// <summary> /// Initialises a new instance of the ApplicationMetrics.PerformanceCounterMetricLoggerImplementation class. /// </summary> /// <param name="metricCategoryName">The name of the performance counter category which the metric events should be logged under.</param> /// <param name="metricCategoryDescription">The description of the performance counter category which the metric events should be logged under.</param> /// <param name="bufferProcessingStrategy">Object which implements a processing strategy for the buffers (queues).</param> /// <param name="intervalMetricChecking">Specifies whether an exception should be thrown if the correct order of interval metric logging is not followed (e.g. End() method called before Begin()).</param> public PerformanceCounterMetricLoggerImplementation(string metricCategoryName, string metricCategoryDescription, IBufferProcessingStrategy bufferProcessingStrategy, bool intervalMetricChecking) : base(bufferProcessingStrategy, intervalMetricChecking) { InitialisePrivateMembers(metricCategoryName, metricCategoryDescription); counterCreationDataFactory = new CounterCreationDataFactory(); performanceCounterCategory = new PerformanceCounterCategory(); performanceCounterFactory = new PerformanceCounterFactory(); }
public WarewolfPerformanceCounterRegister(IPerformanceCounterCategory performanceCounterCategory, IList <IPerformanceCounter> counters, IList <IResourcePerformanceCounter> resourcePerformanceCounters) { _performanceCounterCategory = performanceCounterCategory; RegisterCountersOnMachine(counters, GlobalConstants.Warewolf); RegisterCountersOnMachine(resourcePerformanceCounters.Cast <IPerformanceCounter>().ToList(), GlobalConstants.WarewolfServices); Counters = counters; ResourceCounters = resourcePerformanceCounters; }
//------------------------------------------------------------------------------ // // Method: PerformanceCounterMetricLoggerImplementation (constructor) // //------------------------------------------------------------------------------ /// <summary> /// Initialises a new instance of the ApplicationMetrics.PerformanceCounterMetricLoggerImplementation class. Note this is an additional constructor to facilitate unit tests, and should not be used to instantiate the class under normal conditions. /// </summary> /// <param name="metricCategoryName">The name of the performance counter category which the metric events should be logged under.</param> /// <param name="metricCategoryDescription">The description of the performance counter category which the metric events should be logged under.</param> /// <param name="bufferProcessingStrategy">Object which implements a processing strategy for the buffers (queues).</param> /// <param name="intervalMetricChecking">Specifies whether an exception should be thrown if the correct order of interval metric logging is not followed (e.g. End() method called before Begin()).</param> /// <param name="counterCreationDataCollection">A test (mock) counter creation data collection object.</param> /// <param name="counterCreationDataFactory">A test (mock) counter creation data factory object.</param> /// <param name="performanceCounterCategory">A test (mock) performance counter category object.</param> /// <param name="performanceCounterFactory">A test (mock) performance counter factory object.</param> /// <param name="dateTime">A test (mock) DateTime object.</param> /// <param name="exceptionHandler">A test (mock) exception handler object.</param> public PerformanceCounterMetricLoggerImplementation(string metricCategoryName, string metricCategoryDescription, IBufferProcessingStrategy bufferProcessingStrategy, bool intervalMetricChecking, ICounterCreationDataCollection counterCreationDataCollection, ICounterCreationDataFactory counterCreationDataFactory, IPerformanceCounterCategory performanceCounterCategory, IPerformanceCounterFactory performanceCounterFactory, IDateTime dateTime, IExceptionHandler exceptionHandler) : base(bufferProcessingStrategy, intervalMetricChecking, dateTime, exceptionHandler) { InitialisePrivateMembers(metricCategoryName, metricCategoryDescription); this.counterCreationDataCollection = counterCreationDataCollection; this.counterCreationDataFactory = counterCreationDataFactory; this.performanceCounterCategory = performanceCounterCategory; this.performanceCounterFactory = performanceCounterFactory; }
//------------------------------------------------------------------------------ // // Method: PerformanceCounterMetricLogger (constructor) // //------------------------------------------------------------------------------ /// <summary> /// Initialises a new instance of the ApplicationMetrics.PerformanceCounterMetricLogger class. Note this is an additional constructor to facilitate unit tests, and should not be used to instantiate the class under normal conditions. /// </summary> /// <param name="metricCategoryName">The name of the performance counter category which the metric events should be logged under.</param> /// <param name="metricCategoryDescription">The description of the performance counter category which the metric events should be logged under.</param> /// <param name="bufferProcessingStrategy">Object which implements a processing strategy for the buffers (queues).</param> /// <param name="intervalMetricChecking">Specifies whether an exception should be thrown if the correct order of interval metric logging is not followed (e.g. End() method called before Begin()).</param> /// <param name="counterCreationDataCollection">A test (mock) counter creation data collection object.</param> /// <param name="counterCreationDataFactory">A test (mock) counter creation data factory object.</param> /// <param name="performanceCounterCategory">A test (mock) performance counter category object.</param> /// <param name="performanceCounterFactory">A test (mock) performance counter factory object.</param> /// <param name="dateTime">A test (mock) DateTime object.</param> /// <param name="exceptionHandler">A test (mock) exception handler object.</param> public PerformanceCounterMetricLogger(string metricCategoryName, string metricCategoryDescription, IBufferProcessingStrategy bufferProcessingStrategy, bool intervalMetricChecking, ICounterCreationDataCollection counterCreationDataCollection, ICounterCreationDataFactory counterCreationDataFactory, IPerformanceCounterCategory performanceCounterCategory, IPerformanceCounterFactory performanceCounterFactory, IDateTime dateTime, IExceptionHandler exceptionHandler) { loggerImplementation = new PerformanceCounterMetricLoggerImplementation(metricCategoryName, metricCategoryDescription, bufferProcessingStrategy, intervalMetricChecking, counterCreationDataCollection, counterCreationDataFactory, performanceCounterCategory, performanceCounterFactory, dateTime, exceptionHandler); }