[Mono-list] Network Interface // Performance counters

Torstensson, Patrik patrik.torstensson@intel.com
Wed, 6 Aug 2003 10:20:23 +0100


Hi guys,

Just to be clear, performance collectors are not writing to the registry
all of the time. The performance counter key is just a shortcut to a
in-memory server that polls all performance monitor extensions for new
performance information. Don't ask why they added the possibility to
poll the registry for the performance information, maybe a old design
flaw.

It shouldn't be that hard to add a wrapper that checks what counter has
been requested and polls the devices instead.

Cheers,
 Patrik
>=20
> -----Original Message-----
> From: Ivan Hawkes [mailto:blackhawk@ivanhawkes.com]=20
> Sent: Wednesday, August 06, 2003 9:43 AM
> To: Timothy Parez; mono-list@lists.ximian.com
>=20
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>=20
> On Tuesday 05 Aug 2003 11:06 pm, Timothy Parez wrote:
> > Hi,
> >
> > In .NET/Win2k I would use performance counters to
> >
> >   a.. Check the bandwith of the network
> >   b.. Check the bytes/sec upload
> >   c.. Check the bytes/sec download
> >   d.. Check the pakkets/sec upload
> >   e.. Check the pakkets/sec download
> > I would like to do the same thing but have it working on linux.
> > I don't assume performance counters are available?
> > So how would I do this ?
> >
> > Thnx
> > Timothy
>=20
> This may be tricky under Mono because of the way performance=20
> counters are=20
> provided by Windows. They are really just code that writes=20
> constantly to the=20
> registry as far as I could tell. I had a few goes using them=20
> with C++ and the=20
> ATL but in the end it was soooo much trouble I just got=20
> something to output=20
> an XML file every 10 seconds instead. Slack, I know, but it=20
> solved the=20
> problem :-)
>=20
> I guess instead of using the registry these could be moved to=20
> the /proc=20
> filesytem and the support libraries written to handle it like=20
> this. Windows=20
> required you to also put either a COM interface on your=20
> service or use=20
> something like sockets to comunicate with a DLL you supplied=20
> to pass the=20
> counters along. Very messy. I'm sure Mono and Linux can do=20
> something a lot=20
> nicer than that :-)
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
>=20
> iQIVAwUBPzCxd/r1e7bH1pzBAQJwdg/+LZA0xIsfDMy/sIKKJEBBDhAKnwXkqctw
> n2q+eek+BYuObkCKh+UHdbszNOAJyX7ZCPx4z43cVSdvNc0M31lrdgQWPKOy7Rs3
> vBLuHSyyN4C2YVzc/AtOoDhT9ho6baEJCfimfHJvudcIMwl78OnrZiwwS7qEr/Vh
> bmmOci6Zq2VP8KKOh3ZBVOQ4zmf8QSe8tvwy0yTE5ad0Gd2dUC18f5Pn32cI3f10
> 9/cJwPduaZV4/eOnbwa7pd4HTpcslSQBNOj0h0z1qMl2CafaODEyUr3X585k7/Uy
> 0cNH2jm0qgCRYlnwbaT9/fKL3sTXwoM3yzvRZegRb8kx1aN0mNOWrMUJ//cf9uw3
> cZ6jd57zbzNq8fpTkH1fLqavtX6tLSZcSkdjLtllHAFGOKfcop9sZIOD36zwihpA
> Dyhy1nfiIieeo9c/+vAoa7hcEDzFxZ3r/WYQv7U9sod8G9lJcPtVHCDFxbW3PZfS
> Ial6cwgthR3+IUtvq2hZ7py55LWe4krIFXry7WsW8wTKtVpiSesBQK1P/Fec/0kn
> yTt7/5dqIeAUKabd8acGeaT3/E5jT3UsVcD9YtatMOChSLlgqLIsAkK9mOqAqFKQ
> UgVSKgkUyKDzYSbuc0o/AgXsp56yjEYCWBL8RDdYHeuK9PCaEiu+16O3LpNW42IT
> iSu0Gfa4BtQ=3D
> =3DChqb
> -----END PGP SIGNATURE-----
>=20
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>=20