Fix: fix transfer stats receiving seconds instead of ms to work with
This commit is contained in:
committed by
Sheepit Renderfarm
parent
456bae15b0
commit
4153a45846
@@ -536,7 +536,7 @@ public class Server extends Thread {
|
|||||||
gui_.displayTransferStats(dlStats, ulStats);
|
gui_.displayTransferStats(dlStats, ulStats);
|
||||||
gui_.status(status_, 100, size);
|
gui_.status(status_, 100, size);
|
||||||
|
|
||||||
this.log.debug(String.format("File downloaded at %s/s, written %d bytes", new TransferStats(size, duration.getSeconds() + 1).getAverageSessionSpeed(), written));
|
this.log.debug(String.format("File downloaded at %s/s, written %d bytes", new TransferStats(size, duration.toMillis() + 1).getAverageSessionSpeed(), written));
|
||||||
|
|
||||||
this.lastRequestTime = new Date().getTime();
|
this.lastRequestTime = new Date().getTime();
|
||||||
return Error.Type.OK;
|
return Error.Type.OK;
|
||||||
@@ -613,7 +613,7 @@ public class Server extends Thread {
|
|||||||
this.ulStats.calc(fileHandler.length(), ((duration.getSeconds() * 1000) + (duration.getNano() / 1000000)));
|
this.ulStats.calc(fileHandler.length(), ((duration.getSeconds() * 1000) + (duration.getNano() / 1000000)));
|
||||||
gui.displayTransferStats(dlStats, ulStats);
|
gui.displayTransferStats(dlStats, ulStats);
|
||||||
|
|
||||||
this.log.debug(String.format("File uploaded at %s/s, uploaded %d bytes", new TransferStats(fileHandler.length(), duration.getSeconds() + 1).getAverageSessionSpeed(), fileHandler.length()));
|
this.log.debug(String.format("File uploaded at %s/s, uploaded %d bytes", new TransferStats(fileHandler.length(), duration.toMillis() + 1).getAverageSessionSpeed(), fileHandler.length()));
|
||||||
|
|
||||||
int r = response.code();
|
int r = response.code();
|
||||||
String contentType = response.body().contentType().toString();
|
String contentType = response.body().contentType().toString();
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import lombok.AllArgsConstructor;
|
|||||||
|
|
||||||
/****************
|
/****************
|
||||||
* Holds the session traffic statistics. The constructor accepts two parameters:
|
* Holds the session traffic statistics. The constructor accepts two parameters:
|
||||||
* @long bytes - bytes transferred in the session
|
* long bytes - bytes transferred in the session
|
||||||
* @Job seconds - seconds spent transferring the data
|
* long millis - milliseconds spent transferring the data
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class TransferStats {
|
public class TransferStats {
|
||||||
|
|||||||
Reference in New Issue
Block a user