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

前端之家收集整理的这篇文章主要介绍了从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

猜你在找的asp.Net相关文章