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