Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to measure bandwidth in a Java web application?

Tags:

java

bandwidth

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 idea

like image 723
allenskd Avatar asked Mar 30 '26 18:03

allenskd


1 Answers

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.

like image 69
Johan Sjöberg Avatar answered Apr 02 '26 14:04

Johan Sjöberg