我想强调测试我的Web Api自托管应用程序。此应用程序托管在Azure辅助角色上。
我知道如何从我的工作者角色到我的存储(用于分析)获得性能计数器,但因为我的web api是使用Microsoft.Owin.Host.HttpListener自托管的,所以我不知道是否有一些我可以插入的现有性能计数器。
我已经尝试了几个计数器perfmon:
当我选择流程时,我没有像req / sec等那样有趣的计数器...
有没有办法为Self Hosted Owin应用程序激活一些计数器?
仅使用我尚未制作的配置? 使用其他自我主持人? 使用其他组件并修改我的代码? (添加属性......,我已经看到类似https://github.com/aliostad/PerfIt的内容)
非常感谢。
答案 0 :(得分:1)
我看到你提到了诊断,这些是我在诊断中使用的:
<PerformanceCounterConfiguration counterSpecifier="\Asp.net\Request Execution Time" sampleRate="PT1M" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.net\Requests Rejected" sampleRate="PT1M" />
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\Current Connections" sampleRate="PT1M" />
<PerformanceCounterConfiguration counterSpecifier="\Web Service(_Total)\Connection Attempts/sec" sampleRate="PT1M" />
我做了什么,进入perfmon并在我的开发机器上右键单击“添加计数器”,然后在cmd提示符下键入与我相似的名称,如下所示:
typeperf "\Web Service(_Total)\Connection Attempts/sec"
我能够测试很多,看看哪些是有用的。
希望它有所帮助,
=德文