[Mono-list] Network Interface // Performance counters

Ivan Hawkes blackhawk@ivanhawkes.com
Wed, 6 Aug 2003 08:42:47 +0100


=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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

This may be tricky under Mono because of the way performance counters are=20
provided by Windows. They are really just code that writes constantly to th=
e=20
registry as far as I could tell. I had a few goes using them with C++ and t=
he=20
ATL but in the end it was soooo much trouble I just got something to output=
=20
an XML file every 10 seconds instead. Slack, I know, but it solved the=20
problem :-)

I guess instead of using the registry these could be moved to the /proc=20
filesytem and the support libraries written to handle it like this. Windows=
=20
required you to also put either a COM interface on your service or use=20
something like sockets to comunicate with a DLL you supplied to pass the=20
counters along. Very messy. I'm sure Mono and Linux can do something a lot=
=20
nicer than that :-)
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

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
=2D----END PGP SIGNATURE-----