Get Performance Counter Instance Name (w3wp#XX) from ASP.NET worker process ID

后端 未结 5 1617
死守一世寂寞
死守一世寂寞 2020-12-31 06:23

I would like to display some memory statistics (working set, GCs etc.) on a web page using the .NET/Process performance counters. Unfortunately, if there are multiple applic

5条回答
  •  离开以前
    2020-12-31 07:07

    The example by chiru does not work in a specific case - when you have two versions of the same program, named the same, and one is not .net and you start the .net version after the non-.net version. The .Net version will be named applicaion#1 but when you access the CLR perf counters using this name, the instance names on the counter has the name withouth the #1, so you get failures.

    Nick.

提交回复
热议问题