Mono ASP.Net Web Service CacheDuration hit ratio, under Linux
-
19-09-2019 - |
Question
I have developed an ASP.Net Web Service targeting Mono. I have deployed it to an OpenSUSE 11.1 VM running Mono under Apache.
Is there a way to monitor the @OutputCache hit ratio for my ASP.Net app deployed for Mono under a Linux OS similar to the Windows Performance Monitor, for example? This does not have to necessarily involve performance counters, but rather a method for getting the ratio.
This is related to WebMethod calls decorated with the CacheDuration attribute, not a custom data caching scheme.
Solution
Mono has supported .NET "Performance Counters" since Mono 2.0, but AFAICT only three standard ASP.NET counters are currently implemented: Requests Queued, Requests Total, and Requests/sec. I imagine others, such as the cache hit ratio, would be pretty straightforward to implement.
You can inspect the performance counters using the performance counters API or the mperfmon GUI tool.