/// <summary> /// Create a Performance counter install attribute to assist in run-time perfmon counter creation /// </summary> /// <param name="type">This counters internal type. Needed base types are automagically created with the name appended with 'base'</param> /// <param name="category">This counters category. All categories are fixed at the time of creation</param> /// <param name="lifetime">This counters lifetime, by default all counters are global except for dynamically created instances</param> /// <param name="categoryType">The category type (multi or single instance)</param> /// <param name="ConnectInstancetype">The CSGO instance type </param> /// <param name="counterName">This counters name</param> /// <param name="counterHelp">This counters help string</param> public PerformanceCounterInstallAttribute( PerformanceCounterType type, PerformanceCounterCategories category, PerformanceCounterInstanceLifetime lifetime, PerformanceCounterCategoryType categoryType, CounterInstanceType counterInstancetype, string counterName, string counterHelp, string instanceType) { _type = type; _category = category; _lifeTime = lifetime; _categoryType = categoryType; _counterInstanceType = counterInstancetype; _counterName = counterName; _counterHelp = counterHelp; _instanceType = instanceType; }
//========================================================================================================// /// <summary> /// Creates friendly counter categories from enums /// </summary> /// <param name="cat"></param> /// <returns></returns> public static string CounterCategory(PerformanceCounterCategories cat) { String perfCounterSource = App.InstanceName; switch (cat) { case PerformanceCounterCategories.Comm: return "CSGO:Communications:" + perfCounterSource; case PerformanceCounterCategories.Core: return "CSGO:Core:" + perfCounterSource; case PerformanceCounterCategories.Data: return "CSGO:Data:" + perfCounterSource; default: Logger.Log("Category Name not found: " + cat.ToString()); return cat.ToString().Replace("_", ":") + ":" + perfCounterSource; ; } }