How to measure bandwidth in a Java web application?
I'm creating a java application where each client is isolated, the application will have a data plan where a limit of storage and bandwidth is set, measuring storage is already done, but bandwidth.. I have no开发者_JAVA技巧 idea
See this thread if you want to limit bandwidth. In short there seems to be no good way but to interleave sending bytes with Thread.sleep().
If you however wish to monitor bandwidth you can do that e.g., by measuring the time taken to send a fixed number of bytes over the network, as described in Java Distributed Computed.
精彩评论