private void PopulateCounterCategoryData(PerformanceCountersDefinitionAttribute attribute, Assembly originalAssembly, PerformanceCounterInstaller installer) { installer.CategoryName = attribute.CategoryName; installer.CategoryHelp = GetCategoryHelp(attribute, originalAssembly); installer.CategoryType = attribute.CategoryType; }
private PerformanceCounterInstaller GetOrCreateInstaller(Type instrumentedType, IList <Installer> installers) { PerformanceCountersDefinitionAttribute attribute = (PerformanceCountersDefinitionAttribute)instrumentedType.GetCustomAttributes(typeof(PerformanceCountersDefinitionAttribute), false)[0]; PerformanceCounterInstaller installer = GetExistingInstaller(attribute.CategoryName, installers); if (installer == null) { installer = new PerformanceCounterInstaller(); PopulateCounterCategoryData(attribute, instrumentedType.Assembly, installer); installers.Add(installer); } return(installer); }
internal static string GetCategoryHelp(PerformanceCountersDefinitionAttribute attribute, Assembly originalAssembly) { return(GetResourceString(attribute.CategoryHelp, originalAssembly)); }