I have created a multi-instance performance counter and I pass it mixed case instance names but somehow the instance names get converted to lower case when I view them both through code and in perfmon. Does anyone know how to prevent this? Found this on google, thought it was nice of Luke Zhang to never follow up.
I used Reflector to look at the code in System.dll for the PerformanceCounter. In the private Initialize event is this little nugget:
this.sharedCounter = new SharedPerformanceCounter(categoryName.ToLower(CultureInfo.InvariantCulture), this.counterName.ToLower(CultureInfo.InvariantCulture), this.instanceName.ToLower(CultureInfo.InvariantCulture), this.instanceLifetime);
I think that's why.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With