In want to diagnose a bottleneck which happens when my client is talking to a server on the other side of the world. I'd like to run the server on my local machine and simulate the latency. Is there a way I can inject a brief thread-sleep in all remote calls? I'm not sure which remote call is the bottleneck, so I need to delay them all.
Second attempt to clarify: I don't want to copy-paste thread sleeps into every single remote method, because there are lots and lots of remote methods. I'm trying to find a way to inject a sleep into the RMI subsystem so all calls over RMI will be delayed.
WANem is designed to do just that. It works at the network level so isn't Java- or RMI-specific.
The Charles Proxy server has a feature where it can add throttling/latency to a connection:
http://www.charlesproxy.com/documentation/proxying/throttling/
I have been very pleased with Charles -- well worth the $50 for a license.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With