Client send duration and remaining render time
This commit is contained in:
@@ -905,7 +905,9 @@ public class Client {
|
||||
date_parse = date_parse_hour;
|
||||
}
|
||||
date_parse.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
this.gui.status(String.format("Rendering (remaining %s)", Utils.humanDuration(date_parse.parse(remaining_time))));
|
||||
Date date = date_parse.parse(remaining_time);
|
||||
this.gui.status(String.format("Rendering (remaining %s)", Utils.humanDuration(date)));
|
||||
ajob.getProcessRender().setRemainingDuration((int) (date.getTime() / 1000));
|
||||
}
|
||||
catch (ParseException err) {
|
||||
this.log.error("Client::updateRenderingStatus ParseException " + err);
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.Date;
|
||||
public class RenderProcess {
|
||||
private long start;
|
||||
private long end;
|
||||
private int remainingDuration;
|
||||
private long memoryUsed; // in kB
|
||||
private Process process;
|
||||
|
||||
@@ -32,6 +33,7 @@ public class RenderProcess {
|
||||
start = -1;
|
||||
end = -1;
|
||||
memoryUsed = 0;
|
||||
remainingDuration = 0;
|
||||
}
|
||||
|
||||
public void setMemoryUsed(long val) {
|
||||
@@ -64,6 +66,18 @@ public class RenderProcess {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return duration in seconds
|
||||
*/
|
||||
public int getRemainingDuration() {
|
||||
return remainingDuration;
|
||||
}
|
||||
|
||||
public void setRemainingDuration(int val) {
|
||||
remainingDuration = val;
|
||||
}
|
||||
|
||||
public void finish() {
|
||||
end = new Date().getTime();
|
||||
process = null;
|
||||
|
||||
@@ -116,6 +116,10 @@ public class Server extends Thread implements HostnameVerifier, X509TrustManager
|
||||
if (this.client.getRenderingJob().getExtras() != null && this.client.getRenderingJob().getExtras().isEmpty() == false) {
|
||||
args += "&extras=" + this.client.getRenderingJob().getExtras();
|
||||
}
|
||||
if (this.client.getRenderingJob().getProcessRender() != null) {
|
||||
args += "&rendertime=" + this.client.getRenderingJob().getProcessRender().getDuration();
|
||||
args += "&remainingtime=" + this.client.getRenderingJob().getProcessRender().getRemainingDuration();
|
||||
}
|
||||
}
|
||||
|
||||
HttpURLConnection connection = this.HTTPRequest(this.base_url + "/server/keepmealive.php" + args);
|
||||
|
||||
Reference in New Issue
Block a user