public static void GetCounters(object objCounterProperties, out SqlChars object_name, out SqlChars counter_name, out SqlChars instance_name) { CounterProperties counterProperties = (CounterProperties)objCounterProperties; object_name = new SqlChars(counterProperties.objectName); counter_name = new SqlChars(counterProperties.counterName); instance_name = new SqlChars(counterProperties.instanceName); }
private void InstallCounters(string name) { if (IsValidCategory(name) == false) { var counterCreationData = CounterProperties.Select(p => { var attribute = GetPerformanceCounterAttribute(p); return(new CounterCreationData(attribute.Name, attribute.Description, attribute.CounterType)); }).ToArray(); var createDataCollection = new CounterCreationDataCollection(counterCreationData); PerformanceCounterCategory.Create(CategoryName, "RavenDB Performance Counters", PerformanceCounterCategoryType.MultiInstance, createDataCollection); PerformanceCounter.CloseSharedResources(); // http://blog.dezfowler.com/2007/08/net-performance-counter-problems.html } }