The Ice run time calls bytesReceived as it reads from the network and
bytesSent as it writes to the network. A very simple implementation of the
Stats interface could look like the following:
To register your implementation, you must pass it in an InitializationData parameter when you call initialize to create the communicator (see
Section 28.3):
You can install a Stats object on either the client or the server side (or both). Here is some example output produced by installing a
MyStats object in a simple server:
In practice, your Stats implementation will probably be a bit more sophisticated: for example, the object can accumulate statistics in member variables and make the accumulated statistics available via member functions, instead of simply printing everything to the standard error output.