The WCF has such structure of the performance counter names:
http://msdn.microsoft.com/en-us/library/ms735098.aspx
ServiceName@ServiceBaseAddress
(ServiceName).(ContractName)@(endpoint listener address)
(ServiceName).(ContractName).(OperationName)@(first endpoint listener address)
In MSDN we have:
"There is a limit on the length of a performance counter instance's name. When a Windows Communication Foundation (WCF) counter instance name exceeds the maximum length, WCF replaces a portion of the instance name with a hash value." http://msdn.microsoft.com/en-us/library/ms731052.aspx
In my case WCF has generated the names:
notif28.inoti60.removebyrefer54@82rapper|notificationwrapper.svc
notif28.inoti60.removebymsgid@82rapper|notificationwrapper.svc
notif28.inoti60.removebyemailid@82rapper|notificationwrapper.svc
notif28.inoti60.schedule@82rapper|notificationwrapper.svc
(Sorry for
rapper :) Originally it was
Wrapper)
The question is:
Can I use these names as hard-coded names or
next time the WCF could generate different names???
BTW Such names with a hash value are disaster if I need to use the performance counters in my code.
Say I'd like to get counters for the operation with name "RemoveByReferenceMessage" name.
How I can find my counters with code if I have names:
notif28.inoti60.removebyrefer54@82rapper|notificationwrapper.svc
notif28.inoti60.removebymsgid@82rapper|notificationwrapper.svc
notif28.inoti60.removebyemailid@82rapper|notificationwrapper.svc
notif28.inoti60.schedule@82rapper|notificationwrapper.svc
???
How many chars of the operation name I have to use for search?
How many chars of the endpoint name I have to use for search?
How many chars of the service name I have to use for search?
One good part of this is that is the hash algorithm always gives us the same names. Al last in my experience.
Now I know only one method to use WCF performance counter names in the custom code:
-
Start WCF service and get the generated performance counter names from the PerfMon.
-
Use these names in the code.
Disadvantages: After any change in the ServiceName, ContractName, OperationName, ServiceBaseAddress, EndpointListenerAddress we have to repeat these steps again.