[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
(http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=78390)
Regards,
Joannès
-----------------
Here's a place that describes the Windows counters:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/counter/cou
nters1_lkxw.asp?frame=true
And here's something similar for the Framework:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/ht
ml/gngrfPerformanceCounters.asp?frame=true
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.
David
------------------
-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Joannes
Vermorel
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
Joannès
-----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
mono,
> 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
--
-----------------------------------------------------------------
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
http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list