Client send duration and remaining render time
This commit is contained in:
@@ -145,6 +145,8 @@ Parameter as GET or POST:
|
|||||||
* job: Id of the rendering job
|
* job: Id of the rendering job
|
||||||
* frame: Frame number of the rendering job
|
* frame: Frame number of the rendering job
|
||||||
* extras: Extras data get on job request of the rendering job
|
* extras: Extras data get on job request of the rendering job
|
||||||
|
* rendertime: current render time (optional)
|
||||||
|
* remainingtime: current remaining time to render the frame (optional)
|
||||||
|
|
||||||
Answer:
|
Answer:
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
|||||||
@@ -905,7 +905,9 @@ public class Client {
|
|||||||
date_parse = date_parse_hour;
|
date_parse = date_parse_hour;
|
||||||
}
|
}
|
||||||
date_parse.setTimeZone(TimeZone.getTimeZone("GMT"));
|
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) {
|
catch (ParseException err) {
|
||||||
this.log.error("Client::updateRenderingStatus ParseException " + err);
|
this.log.error("Client::updateRenderingStatus ParseException " + err);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import java.util.Date;
|
|||||||
public class RenderProcess {
|
public class RenderProcess {
|
||||||
private long start;
|
private long start;
|
||||||
private long end;
|
private long end;
|
||||||
|
private int remainingDuration;
|
||||||
private long memoryUsed; // in kB
|
private long memoryUsed; // in kB
|
||||||
private Process process;
|
private Process process;
|
||||||
|
|
||||||
@@ -32,6 +33,7 @@ public class RenderProcess {
|
|||||||
start = -1;
|
start = -1;
|
||||||
end = -1;
|
end = -1;
|
||||||
memoryUsed = 0;
|
memoryUsed = 0;
|
||||||
|
remainingDuration = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMemoryUsed(long val) {
|
public void setMemoryUsed(long val) {
|
||||||
@@ -64,6 +66,18 @@ public class RenderProcess {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return duration in seconds
|
||||||
|
*/
|
||||||
|
public int getRemainingDuration() {
|
||||||
|
return remainingDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemainingDuration(int val) {
|
||||||
|
remainingDuration = val;
|
||||||
|
}
|
||||||
|
|
||||||
public void finish() {
|
public void finish() {
|
||||||
end = new Date().getTime();
|
end = new Date().getTime();
|
||||||
process = null;
|
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) {
|
if (this.client.getRenderingJob().getExtras() != null && this.client.getRenderingJob().getExtras().isEmpty() == false) {
|
||||||
args += "&extras=" + this.client.getRenderingJob().getExtras();
|
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);
|
HttpURLConnection connection = this.HTTPRequest(this.base_url + "/server/keepmealive.php" + args);
|
||||||
|
|||||||
Reference in New Issue
Block a user