Service Model performance counters Instance Name

邮差的信 提交于 2019-12-06 16:37:54

I know it is not ideal, but you could copy the current .NET implementation for generating counter instance names to your own code/application to programatically generate the same names from the full service name and address.

You can see the code used by WCF here:

For SerivcePerformanceCounters:

http://referencesource.microsoft.com/#System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersBase.cs,6d61d34585241697

For EndpointPerformanceCounters:

http://referencesource.microsoft.com/#System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersBase.cs,e3319d41297320e3

For OperationPerformanceCounters:

http://referencesource.microsoft.com/#System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersBase.cs,5e170817afd5d0ba

The downside is that any change to the .NET algorithm for naming instances will break your implementation.

I'm as frustrated as you surely are, but haven't found a better solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!