/// <summary> /// Creates a <see cref="PerformanceCounterCallHandler"/> using the given settings. /// </summary> /// <param name="category">Performance counter category to update. This counter category /// must be installed separately or the handler will fail.</param> /// <param name="instanceName">Counter instance name. This may include replacement /// tokens. See the <see cref="MethodInvocationFormatter"/> class for a list of the tokens.</param> /// <param name="useTotalCounter">Should a "Total" instance be updated?</param> /// <param name="incrementNumberOfCalls">Should the number of calls counter be updated?</param> /// <param name="incrementCallsPerSecond">Should the "calls / second" counter be updated?</param> /// <param name="incrementAverageCallDuration">Should the "average seconds / call" counter be updated?</param> /// <param name="incrementTotalExceptions">Should the "# of exceptions" counter be updated?</param> /// <param name="incrementExceptionsPerSecond">Should the "# exceptions / second" counter be updated?</param> /// <param name="handlerOrder">Order of the handler.</param> public PerformanceCounterCallHandler( string category, string instanceName, bool useTotalCounter, bool incrementNumberOfCalls, bool incrementCallsPerSecond, bool incrementAverageCallDuration, bool incrementTotalExceptions, bool incrementExceptionsPerSecond, int handlerOrder) { this.category = category; this.instanceName = instanceName; this.useTotalCounter = useTotalCounter; this.incrementNumberOfCalls = incrementNumberOfCalls; this.incrementCallsPerSecond = incrementCallsPerSecond; this.incrementAverageCallDuration = incrementAverageCallDuration; this.incrementTotalExceptions = incrementTotalExceptions; this.incrementExceptionsPerSecond = incrementExceptionsPerSecond; counterFactory = new EnterpriseLibraryPerformanceCounterFactory(); this.order = handlerOrder; }
/// <summary> /// Creates a <see cref="PerformanceCounterCallHandler"/> using the given category /// and instance name. /// </summary> /// <remarks>See the <see cref="PerformanceCounterCallHandlerDefaults"/> for a list /// of the default values for each property.</remarks> /// <param name="category">Performance counter category to update. This counter category /// must be installed separately or the handler will fail.</param> /// <param name="counterInstanceName">Counter instance name. This may include replacement /// tokens. See the <see cref="MethodInvocationFormatter"/> class for a list of the tokens.</param> public PerformanceCounterCallHandler(string category, string counterInstanceName) { this.category = category; this.instanceName = counterInstanceName; this.useTotalCounter = PerformanceCounterCallHandlerDefaults.UseTotalCounter; this.incrementNumberOfCalls = PerformanceCounterCallHandlerDefaults.IncrementNumberOfCalls; this.incrementCallsPerSecond = PerformanceCounterCallHandlerDefaults.IncrementCallsPerSecond; this.incrementAverageCallDuration = PerformanceCounterCallHandlerDefaults.IncrementAverageCallDuration; this.incrementTotalExceptions = PerformanceCounterCallHandlerDefaults.IncrementTotalExceptions; this.incrementExceptionsPerSecond = PerformanceCounterCallHandlerDefaults.IncrementExceptionsPerSecond; counterFactory = new EnterpriseLibraryPerformanceCounterFactory(); }
public void SetUp() { factory = new EnterpriseLibraryPerformanceCounterFactory(); }