This commit is contained in:
@@ -4,6 +4,8 @@ package com.imyeyu.io;
|
||||
import com.imyeyu.java.TimiJava;
|
||||
import com.imyeyu.java.bean.CallbackArg;
|
||||
import com.imyeyu.utils.Calc;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -41,9 +43,18 @@ public class IOSpeedService {
|
||||
private static IOSpeedService service;
|
||||
|
||||
/** 加盐,用于在数据对齐的 IO 流中看起来像非对齐传输。此操作会使计算数据变得非真实,仅作为 UI 显示时可使用 */
|
||||
@Setter
|
||||
@Getter
|
||||
private long salt;
|
||||
private Timer timer;
|
||||
private double totalBufferOld, totalBuffer;
|
||||
private double totalBufferOld;
|
||||
|
||||
/** 总缓冲量 */
|
||||
@Getter
|
||||
private double totalBuffer;
|
||||
|
||||
/** true 为运行中 */
|
||||
@Getter
|
||||
private boolean isRunning;
|
||||
|
||||
private final Map<String, Item> items;
|
||||
@@ -136,15 +147,6 @@ public class IOSpeedService {
|
||||
return items.get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取总缓冲量
|
||||
*
|
||||
* @return 缓冲数据量
|
||||
*/
|
||||
public double getTotalBuffer() {
|
||||
return totalBuffer;
|
||||
}
|
||||
|
||||
/** 重置计算 */
|
||||
public void reset() {
|
||||
totalBufferOld = totalBuffer = 0;
|
||||
@@ -172,23 +174,6 @@ public class IOSpeedService {
|
||||
return service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否运行中
|
||||
*
|
||||
* @return true 为运行中
|
||||
*/
|
||||
public boolean isRunning() {
|
||||
return isRunning;
|
||||
}
|
||||
|
||||
public long getSalt() {
|
||||
return salt;
|
||||
}
|
||||
|
||||
public void setSalt(long salt) {
|
||||
this.salt = salt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加全局字节量监听
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user