public static IPerformanceCounterToken BeginPageHookCreation(string providerName)
        {
            Verify.ArgumentNotNullOrEmpty(providerName, "providerName");

            using (_resourceLocker.Locker)
            {
                IPerformanceCounterProvider provider = GetPerformanceCounterProvider(providerName);

                return(provider.BeginPageHookCreation());
            }
        }
        public static void EndPageHookCreation(string providerName, IPerformanceCounterToken performanceToken, int controlsCompiledCount)
        {
            Verify.ArgumentNotNullOrEmpty(providerName, "providerName");

            using (_resourceLocker.Locker)
            {
                IPerformanceCounterProvider provider = GetPerformanceCounterProvider(providerName);

                provider.EndPageHookCreation(performanceToken, controlsCompiledCount);
            }
        }
        public static IPerformanceCounterToken BeginAspNetControlCompile(string providerName)
        {
            Verify.ArgumentNotNullOrEmpty(providerName, "providerName");

            using (_resourceLocker.Locker)
            {
                IPerformanceCounterProvider provider = GetPerformanceCounterProvider(providerName);

                return(provider.BeginAspNetControlCompile());
            }
        }
        public static void EndElementCreation(string providerName, IPerformanceCounterToken performanceToken, int resultElementCount, int totalElementCount)
        {
            Verify.ArgumentNotNullOrEmpty(providerName, "providerName");

            using (_resourceLocker.Locker)
            {
                IPerformanceCounterProvider provider = GetPerformanceCounterProvider(providerName);

                provider.EndElementCreation(performanceToken, resultElementCount, totalElementCount);
            }
        }
        public static void SystemStartupIncrement(string providerName)
        {
            Verify.ArgumentNotNullOrEmpty(providerName, "providerName");

            using (_resourceLocker.Locker)
            {
                IPerformanceCounterProvider provider = GetPerformanceCounterProvider(providerName);

                provider.SystemStartupIncrement();
            }
        }
        public static void EntityTokenParentCacheMissIncrement(string providerName)
        {
            Verify.ArgumentNotNullOrEmpty(providerName, "providerName");

            using (_resourceLocker.Locker)
            {
                IPerformanceCounterProvider provider = GetPerformanceCounterProvider(providerName);

                provider.EntityTokenParentCacheMissIncrement();
            }
        }
コード例 #7
0
        private static void ValidatePerformanceCounterProvider(IPerformanceCounterProvider provider) {
            Assert.IsNotNull(provider);
            Assert.IsNotEmpty(provider.CategoryName);
            Console.WriteLine("Category name of Provider = " + provider.CategoryName);

            foreach(var perfCounter in provider.PerformanceCounters) {
                Assert.IsNotNull(perfCounter);
                Console.WriteLine("\tPerformanceCounter# Name={0}, NextValue={1}, Help={2}",
                                  perfCounter.CounterName,
                                  perfCounter.NextValue(),
                                  perfCounter.CounterHelp);
            }
        }
コード例 #8
0
        /// <summary>
        /// 제공하는 PerformanceCounter를 등록합니다.
        /// </summary>
        /// <param name="provider">PerformanceCounter 제공자</param>
        private static void RegistPerformanceCounter(IPerformanceCounterProvider provider) {
            provider.ShouldNotBeNull("provider");

            if(IsDebugEnabled)
                log.Debug("해당 Provider의 PerformanceCounter 들을 생성합니다... CategoryName=[{0}]", provider.CategoryName);

            var accessor = DynamicAccessorFactory.CreateDynamicAccessor(provider.GetType(), true);

            foreach(var propName in accessor.GetPropertyNames()) {
                if(accessor.GetPropertyType(propName) == typeof(PerformanceCounter))
                    provider.PerformanceCounters.Add((PerformanceCounter)accessor.GetPropertyValue(provider, propName));
            }
        }
コード例 #9
0
        private static void ValidatePerformanceCounterProvider(IPerformanceCounterProvider provider)
        {
            Assert.IsNotNull(provider);
            Assert.IsNotEmpty(provider.CategoryName);
            Console.WriteLine("Category name of Provider = " + provider.CategoryName);

            foreach (var perfCounter in provider.PerformanceCounters)
            {
                Assert.IsNotNull(perfCounter);
                Console.WriteLine("\tPerformanceCounter# Name={0}, NextValue={1}, Help={2}",
                                  perfCounter.CounterName,
                                  perfCounter.NextValue(),
                                  perfCounter.CounterHelp);
            }
        }
コード例 #10
0
        /// <summary>
        /// 제공하는 PerformanceCounter를 등록합니다.
        /// </summary>
        /// <param name="provider">PerformanceCounter 제공자</param>
        private static void RegistPerformanceCounter(IPerformanceCounterProvider provider)
        {
            provider.ShouldNotBeNull("provider");

            if (IsDebugEnabled)
            {
                log.Debug("해당 Provider의 PerformanceCounter 들을 생성합니다... CategoryName=[{0}]", provider.CategoryName);
            }

            var accessor = DynamicAccessorFactory.CreateDynamicAccessor(provider.GetType(), true);

            foreach (var propName in accessor.GetPropertyNames())
            {
                if (accessor.GetPropertyType(propName) == typeof(PerformanceCounter))
                {
                    provider.PerformanceCounters.Add((PerformanceCounter)accessor.GetPropertyValue(provider, propName));
                }
            }
        }