java获得网络适配器的最大带宽
我想知道如何获得网络适配器的最大带宽
当我打开我的网络设置面板(例如有线连接-100Mb/s)时,我可以读取它,但我希望以图表的方式获得该值。无线是不需要的
我正在使用Ubuntu12.04和Java编码。我看了一下{
提前感谢,
佩德罗
编辑
运行lshw-class network我找到了我想要的:
lshw -class network
*-network
description: Ethernet interface
product: NetXtreme BCM5721 Gigabit Ethernet PCI Express
vendor: Broadcom Corporation
physical id: 0
bus info: pci@0000:04:00.0
logical name: eth0
version: 21
serial: 00:10:18:2d:d6:19
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
如何从Java应用程序中获取此信息
# 1 楼答案
使用Ubuntu上的适配器
ethtool
可以获得链接速度http://www.cyberciti.biz/faq/howto-determine-ethernet-connection-speed/这是理论极限,因此实际达到的速度可能更小
可以使用ProcessBuilder调用系统命令