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

Joannes Vermorel joannes at vermorel.com
Fri Aug 26 03:36:05 EDT 2005

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

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: perfcounter.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050826/51991305/attachment.txt 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PerfCounterPrint.cs
Type: application/octet-stream
Size: 5258 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050826/51991305/attachment.obj 

More information about the Mono-devel-list mailing list