Fix: fix transfer stats receiving seconds instead of ms to work with

This commit is contained in:
harlekin
2023-09-09 10:40:19 +00:00
committed by Sheepit Renderfarm
parent 456bae15b0
commit 4153a45846
2 changed files with 4 additions and 4 deletions

View File

@@ -536,7 +536,7 @@ public class Server extends Thread {
gui_.displayTransferStats(dlStats, ulStats);
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();
return Error.Type.OK;
@@ -613,7 +613,7 @@ public class Server extends Thread {
this.ulStats.calc(fileHandler.length(), ((duration.getSeconds() * 1000) + (duration.getNano() / 1000000)));
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();
String contentType = response.body().contentType().toString();

View File

@@ -4,8 +4,8 @@ import lombok.AllArgsConstructor;
/****************
* Holds the session traffic statistics. The constructor accepts two parameters:
* @long bytes - bytes transferred in the session
* @Job seconds - seconds spent transferring the data
* long bytes - bytes transferred in the session
* long millis - milliseconds spent transferring the data
*/
@AllArgsConstructor
public class TransferStats {