性能计数器是实现每秒平均计数的最佳方法吗?
我想在我的应用程序中包含某种性能计数。 Windows 性能计数器 (Perfmon) 计数器是最好的方法吗?我只是担心对于我想要的只是简单的每秒平均计数来说,可能开销太大了。自己动手是不是更好?
I want to include some sort of performance counts in my application. Are Windows Performance counters (Perfmon) counters the best way to go. I am just worried that maybe it is too much overhead for what am I wanting which is just a simple average per second count. Is it better to just roll my own?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,Perfmon 工作得很好。
为了最大限度地减少任何开销,请在远程计算机上运行 Perfmon。
我使用 Perfmon 从同一网络上的开发计算机上收集 BizTalk 服务器上严肃、深入且有价值的性能数据,并且该过程的每个部分都运行良好。如果没有非常有力的证据,我什至不会考虑任何其他方法来收集同类性能数据。
Yes, Perfmon works quite well.
To minimize any overhead, run Perfmon on a remote machine.
I've used Perfmon to collect serious, in-depth, and valuable performance data on a BizTalk server from a development machine on the same network and every part of the process worked very well. I wouldn't even consider any other method of collecting the same kind of performance data without very strong evidence.
不,性能计数器很草率,不应该用于“关键”计数器。
在高利用率的系统上,性能计数器的更新可能非常缓慢,甚至可能不正确。
No, performance counters are sloppy and should not be used for 'critical' counters.
On high utilized systems performance counters can be updated very slowly and can even be incorrect.