网卡采集,接收、发送带宽数据调整为总字节
This commit is contained in:
@@ -37,10 +37,10 @@ public class NetVO implements Serializable {
|
||||
@Schema(description = "出站丢包")
|
||||
private long outDropped;
|
||||
|
||||
@Schema(description = "发送流量")
|
||||
@Schema(description = "发送流量(发送总字节)")
|
||||
private long outSpeed;
|
||||
|
||||
@Schema(description = "接收流量")
|
||||
@Schema(description = "接收流量(接收总字节)")
|
||||
private long inSpeed;
|
||||
|
||||
@Schema(description = "协商速度")
|
||||
|
||||
@@ -62,8 +62,10 @@ public class NetServiceImpl implements NetService {
|
||||
long prevBytesRecv = net.getBytesRecv();
|
||||
long prevBytesSent = net.getBytesSent();
|
||||
net.updateAttributes();
|
||||
long bytesRecv = net.getBytesRecv() - prevBytesRecv;
|
||||
long bytesSent = net.getBytesSent() - prevBytesSent;
|
||||
long bytesRecv = net.getBytesRecv();
|
||||
long bytesSent = net.getBytesSent();
|
||||
// long bytesRecv = net.getBytesRecv() - prevBytesRecv;
|
||||
// long bytesSent = net.getBytesSent() - prevBytesSent;
|
||||
System.out.println("接口: " + net.getName());
|
||||
System.out.println("入站丢包: " + net.getInDrops());
|
||||
System.out.println("出站丢包: " + net.getCollisions());
|
||||
|
||||
Reference in New Issue
Block a user