如何测量 Java Web 应用程序中的带宽?
我正在创建一个java应用程序,其中每个客户端都是隔离的,该应用程序将有一个数据计划,其中设置了存储和带宽的限制,测量存储已经完成,但是带宽..我不知道
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想限制带宽,请参阅此线程。简而言之,除了使用 Thread.sleep() 交错发送字节之外,似乎没有什么好办法。
但是,如果您希望监视带宽,则可以通过测量通过网络发送固定数量的字节所需的时间来实现,如 Java 分布式计算。
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.