/// <exclude /> public static void CompileAll() { FieldInfo theBuildManagerFieldInfo = typeof(System.Web.Compilation.BuildManager).GetField("_theBuildManager", BindingFlags.NonPublic | BindingFlags.Static); FieldInfo cachesManagerFieldInfo = typeof(System.Web.Compilation.BuildManager).GetField("_caches", BindingFlags.NonPublic | BindingFlags.Instance); object currentBuilderManager = theBuildManagerFieldInfo.GetValue(null); IEnumerable caches = cachesManagerFieldInfo.GetValue(currentBuilderManager) as IEnumerable; Type standardDiskBuildResultCacheType = caches.OfType <object>().Where(f => f.GetType().FullName == "System.Web.Compilation.StandardDiskBuildResultCache").Select(f => f.GetType()).Single(); FieldInfo maxRecompilationsFieldInfo = standardDiskBuildResultCacheType.BaseType.GetField("s_maxRecompilations", BindingFlags.NonPublic | BindingFlags.Static); object oldValue = maxRecompilationsFieldInfo.GetValue(null); maxRecompilationsFieldInfo.SetValue(null, 500); IEnumerable <string> paths = GetControlPaths(); IPerformanceCounterToken performanceCounterToken = PerformanceCounterFacade.BeginAspNetControlCompile(); // ParallelFacade.ForEach(paths, path => // Call to parallelization facade causes a deadlock while starting-up!!! foreach (string path in paths) { int t1 = Environment.TickCount; Type type = BuildManagerHelper.GetCompiledType(path); int t2 = Environment.TickCount; LoggingService.LogVerbose("RGB(180, 180, 255)ControlCompilerService", string.Format("{0} compiled in {1} ms", path, t2 - t1)); } PerformanceCounterFacade.EndAspNetControlCompile(performanceCounterToken, paths.Count()); // maxRecompilationsFieldInfo.SetValue(null, oldValue); }
public static void EndAspNetControlCompile(string providerName, IPerformanceCounterToken performanceToken, int controlsCompiledCount) { Verify.ArgumentNotNullOrEmpty(providerName, "providerName"); using (_resourceLocker.Locker) { IPerformanceCounterProvider provider = GetPerformanceCounterProvider(providerName); provider.EndAspNetControlCompile(performanceToken, controlsCompiledCount); } }
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 EndPageHookCreation(string providerName, IPerformanceCounterToken performanceToken, int controlsCompiledCount) { Verify.ArgumentNotNullOrEmpty(providerName, "providerName"); using (_resourceLocker.Locker) { IPerformanceCounterProvider provider = GetPerformanceCounterProvider(providerName); provider.EndPageHookCreation(performanceToken, controlsCompiledCount); } }
private static IEnumerable <Element> GetChildren(ElementHandle elementHandle, SearchToken searchToken, bool performSecurityCheck, bool useForeign) { if (elementHandle == null) { throw new ArgumentNullException("elementHandle"); } IPerformanceCounterToken performanceToken = PerformanceCounterFacade.BeginElementCreation(); IEnumerable <Element> children; if (ElementProviderRegistry.ElementProviderNames.Contains(elementHandle.ProviderName)) { if ((useForeign == false) || (ElementProviderPluginFacade.IsLocaleAwareElementProvider(elementHandle.ProviderName) == false)) { children = ElementProviderPluginFacade.GetChildren(elementHandle.ProviderName, elementHandle.EntityToken, searchToken).Evaluate(); } else { children = ElementProviderPluginFacade.GetForeignChildren(elementHandle.ProviderName, elementHandle.EntityToken, searchToken).Evaluate(); } } else if (ElementAttachingProviderRegistry.ElementAttachingProviderNames.Contains(elementHandle.ProviderName)) { children = ElementAttachingProviderPluginFacade.GetChildren(elementHandle.ProviderName, elementHandle.EntityToken, elementHandle.Piggyback).Evaluate(); } else { throw new InvalidOperationException(string.Format("No element provider named '{0}' found", elementHandle.ProviderName)); } foreach (Element element in children) { if (element.VisualData.HasChildren == false) { element.VisualData.HasChildren = ElementAttachingProviderFacade.HaveCustomChildElements(element.ElementHandle.EntityToken, element.ElementHandle.Piggyback); } } children = ElementAttachingProviderFacade.AttachElements(elementHandle.EntityToken, elementHandle.Piggyback, children).Evaluate(); int totalElementCount = children.Count(); ElementActionProviderFacade.AddActions(children, elementHandle.ProviderName); if (performSecurityCheck) { children = children.FilterActions().Evaluate(); } PerformanceCounterFacade.EndElementCreation(performanceToken, children.Count(), totalElementCount); return(children); }
public void EndAspNetControlCompile(IPerformanceCounterToken performanceToken, int controlsCompiledCount) { WindowsPerformanceCounterProviderToken windowsPerformanceCounterProviderToken = (WindowsPerformanceCounterProviderToken)performanceToken; windowsPerformanceCounterProviderToken.Stop(); if ((_aspNetControlCompileAverageTime != null) && (_aspNetControlCompileAverageTimeBase != null)) { _aspNetControlCompileAverageTime.IncrementBy(windowsPerformanceCounterProviderToken.StopTicks - windowsPerformanceCounterProviderToken.StartTicks); _aspNetControlCompileAverageTimeBase.IncrementBy(controlsCompiledCount); } }
public void EndPageHookCreation(IPerformanceCounterToken performanceToken, int pageCount) { WindowsPerformanceCounterProviderToken windowsPerformanceCounterProviderToken = (WindowsPerformanceCounterProviderToken)performanceToken; windowsPerformanceCounterProviderToken.Stop(); if ((_pageHookCreationAverageTime != null) && (_pageHookCreationAverageTimeBase != null)) { _pageHookCreationAverageTime.IncrementBy(windowsPerformanceCounterProviderToken.StopTicks - windowsPerformanceCounterProviderToken.StartTicks); _pageHookCreationAverageTimeBase.IncrementBy(pageCount); } }
public void EndElementCreation(IPerformanceCounterToken performanceToken, int resultElementCount, int totalElementCount) { WindowsPerformanceCounterProviderToken windowsPerformanceCounterProviderToken = (WindowsPerformanceCounterProviderToken)performanceToken; windowsPerformanceCounterProviderToken.Stop(); if ((_elementResultCreationAverageTime != null) && (_elementResultCreationAverageTime != null) && (_elementResultCreationAverageTimeBase != null) && (_elementTotalCreationAverageTimeBase != null)) { _elementResultCreationAverageTime.IncrementBy(windowsPerformanceCounterProviderToken.StopTicks - windowsPerformanceCounterProviderToken.StartTicks); _elementTotalCreationAverageTime.IncrementBy(windowsPerformanceCounterProviderToken.StopTicks - windowsPerformanceCounterProviderToken.StartTicks); _elementResultCreationAverageTimeBase.IncrementBy(resultElementCount); _elementTotalCreationAverageTimeBase.IncrementBy(totalElementCount); } }
/// <exclude /> public static void EndAspNetControlCompile(IPerformanceCounterToken performanceToken, int controlsCompiledCount) { _implementation.EndAspNetControlCompile(performanceToken, controlsCompiledCount); }
/// <summary> /// /// </summary> /// <param name="performanceToken">The token returned by BeginElementCreation</param> /// <param name="resultElementCount">Element count after security filtering</param> /// <param name="totalElementCount">Element count before security filtering</param> public static void EndElementCreation(IPerformanceCounterToken performanceToken, int resultElementCount, int totalElementCount) { _implementation.EndElementCreation(performanceToken, resultElementCount, totalElementCount); }
/// <exclude /> public static void EndPageHookCreation(IPerformanceCounterToken performanceToken, int controlsCompiledCount) { _implementation.EndPageHookCreation(performanceToken, controlsCompiledCount); }
public void EndPageHookCreation(IPerformanceCounterToken performanceToken, int controlsCompiledCount) { string providerName = PerformanceCounterProviderRegistry.DefaultPerformanceCounterProviderName; PerformanceCounterProviderPluginFacade.EndPageHookCreation(providerName, performanceToken, controlsCompiledCount); }
public void EndAspNetControlCompile(IPerformanceCounterToken performanceToken, int controlsCompiledCount) { string providerName = PerformanceCounterProviderRegistry.DefaultPerformanceCounterProviderName; PerformanceCounterProviderPluginFacade.EndAspNetControlCompile(providerName, performanceToken, controlsCompiledCount); }
public void EndElementCreation(IPerformanceCounterToken performanceToken, int resultElementCount, int totalElementCount) { string providerName = PerformanceCounterProviderRegistry.DefaultPerformanceCounterProviderName; PerformanceCounterProviderPluginFacade.EndElementCreation(providerName, performanceToken, resultElementCount, totalElementCount); }
public void EndElementCreation(IPerformanceCounterToken performanceToken, int resultElementCount, int totalElementCount) { }
public void EndPageHookCreation(IPerformanceCounterToken performanceToken, int pageCount) { }
public void EndAspNetControlCompile(IPerformanceCounterToken performanceToken, int controlsCompiledCount) { }