public void SetUp()
        {
            factory = new EnterpriseLibraryPerformanceCounterFactory();

            try
            {
                factory.CreateCounter(categoryName, counterName, new string[] { "Total" });
            }
            catch (InvalidOperationException)
            {
                Assert.Inconclusive("In order to run the test, please run RegAssemblies.bat script first as an Administrator.");
            }
        }
        public void CreateCounterFactory()
        {
            counterFactory = new EnterpriseLibraryPerformanceCounterFactory();

            try
            {
                counterFactory.CreateCounter(counterCategoryName, counterName, new string[] { "Total" });
            }
            catch (InvalidOperationException)
            {
                Assert.Inconclusive("In order to run the test, please run RegAssemblies.bat script first as an Administrator.");
            }
        }
 /// <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();
 }
 /// <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>
 public PerformanceCounterCallHandler(
     string category,
     string instanceName,
     bool useTotalCounter,
     bool incrementNumberOfCalls,
     bool incrementCallsPerSecond,
     bool incrementAverageCallDuration,
     bool incrementTotalExceptions,
     bool incrementExceptionsPerSecond)
 {
     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();
 }
Example #5
0
 public void CreateCounterFactory()
 {
     counterFactory = new EnterpriseLibraryPerformanceCounterFactory();
 }
 public void SetUp()
 {
     factory = new EnterpriseLibraryPerformanceCounterFactory();
 }
 public void CreateCounterFactory()
 {
     counterFactory = new EnterpriseLibraryPerformanceCounterFactory();
 }
 public void SetUp()
 {
     factory = new EnterpriseLibraryPerformanceCounterFactory();
 }