[Mono-dev] PerformanceCounter implementation (was: Obtain theavailable memory)

Joannes Vermorel joannes at vermorel.com
Sat Sep 3 09:59:37 EDT 2005

Read on the MSDN Forums about the Performance Counters



Here's a place that describes the Windows counters:

And here's something similar for the Framework:

To find these I searched on msdn.microsoft.com for a specific counter plus
"performance counter".  For example: ".net clr memory performance counter"
found me the Framework page.



-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Joannes
Sent: Friday, 26 August, 2005 9:36
To: mono-devel-list at lists.ximian.com
Subject: RE: [Mono-dev] PerformanceCounter implementation (was: Obtain
theavailable memory)

Thanks for the support Lupus,

Through Perfmon.exe on WinXP (performance monitor app), I can that see that
there is a bit of everything in the performance counters. I think it would
be too much a burden for mono to wrap everything (especially things that are
very OS dependant).

The PerformanceCounter are somehow "self documented" (instantiate a
PerformanceCounter and you can get the documentation through a property).
Attached are a CS file that prints such documentation and the actual result
obtained on WinXP Pro SP2.

This is a selection of what I though to be most useful performance counters.
Among those, my whislist priority would be
1- Memory
2- Process
3- Processor
4- ProcessorPerformance
5- PhysicalDisk / LogicalDisk 
6- Cache


-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Paolo Molaro
Sent: Thursday, 25 August, 2005 15:48
To: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] Obtain the available memory

On 08/25/05 Joannes Vermorel wrote:
> I have seen that the PerformanceCounter class is yet unimplemented in
> yet, I would like to emulate with mono, the following 
> <code>
> PerformanceCounter counter =
> 	new PerformanceCounter("Memory", "Available Bytes");
> </code>
> There is the possibility to resort to command-line and to parse the output
> of the "top -b" command, but I feel that this option is very poor because
> the "top" output is not standardised at all (also this solution may yield
> very poor performance).

While PerformanceCounter is not implemented, on Linux you can read the
/proc/meminfo file:
~$ cat /proc/meminfo 
MemTotal:      1035740 kB

As for PerformanceCounter: as I suggested in the past, someone running
windows should collect the names, types, and meanings of the counters
that we should make available and write them all in one place.
When we'll have that doc, we'll implement the support in mono.


lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com

More information about the Mono-devel-list mailing list