Why do my counter performance indicators reset when the application terminates?

I have a web service that creates its own performance counters for a single instance. When the pool shuts down (or IIS is restarted / restarted) and perfmon restarts, my int64 counters return to 0. Is there a way to create a category and / or counters so that they can withstand the end of the application?

+4
source share
1 answer

Is there a way to create a category and / or counters so that they can withstand the end of the application?

Yes, but only by using performance counters from scratch using the Win32 API and for the component that PerfMon (or remote performance) uses to read the values ​​to display, should it be completely internal code.

In practice, it will be easier to ensure your own constancy of values ​​and set the initial values ​​of the counters at startup (and then this can be saved throughout, for example, when you restart the computer).

+3
source

Source: https://habr.com/ru/post/1379457/


All Articles