微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

从ASP.NET工作进程ID获取性能计数器实例名称(w3wp#XX)

我想使用.NET / Process性能计数器在网页上显示一些内存统计信息(工作集,GC等).不幸的是,如果在该服务器上有多个应用程序池,则使用索引(#1,#2等)进行区分,但是我不知道如何将进程ID(我拥有)与#xx索引相匹配.有没有编程方式(从ASP.NET网页)?

解决方法

Google首次登入:

Multiple CLR performance counters appear that have names that resemble “W3wp#1”

When multiple ASP.NET worker processes
are running,Common Language Runtime
(CLR) performance counters will have
names that resemble “W3wp#1” or
“W3sp#2″and so on. This was remedied
in .NET Framework 2.0 to include a
counter named Process ID in the .NET
CLR Memory performance object. This
counter displays the process ID for an
instance. You can use this counter to
determine the CLR performance counter
that is associated with a process.

KB 281884

By default,Performance Monitor
(Perfmon.msc) displays multiple
processes that have the same name by
enumerating the processes in the
following way:

Process#1 Process#2 Process#3

Performance Monitor can also display
these processes by appending the
process ID (PID) to the name in the
following way:

Process_PID

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐