Calculate exec time in code
This commit is contained in:
parent
86a88d44b7
commit
25737baf82
|
@ -199,6 +199,8 @@ class Job {
|
||||||
var output = '';
|
var output = '';
|
||||||
var stats = [];
|
var stats = [];
|
||||||
|
|
||||||
|
var start_time = new Date().getTime();
|
||||||
|
|
||||||
const proc = cp.spawn(proc_call[0], proc_call.splice(1), {
|
const proc = cp.spawn(proc_call[0], proc_call.splice(1), {
|
||||||
env: {
|
env: {
|
||||||
...this.runtime.env_vars,
|
...this.runtime.env_vars,
|
||||||
|
@ -311,8 +313,11 @@ class Job {
|
||||||
stats = stats[stats.length - 1];
|
stats = stats[stats.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var end_time = new Date().getTime();
|
||||||
|
var exec_time = end_time - start_time;
|
||||||
|
|
||||||
this.logger.debug(`Last stats:`, stats);
|
this.logger.debug(`Last stats:`, stats);
|
||||||
resolve({ stdout, stderr, code, signal, output, stats });
|
resolve({ stdout, stderr, code, signal, output, stats, exec_time });
|
||||||
});
|
});
|
||||||
|
|
||||||
proc.on('error', err => {
|
proc.on('error', err => {
|
||||||
|
@ -323,8 +328,11 @@ class Job {
|
||||||
stats = stats[stats.length - 1];
|
stats = stats[stats.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var end_time = new Date().getTime();
|
||||||
|
var exec_time = end_time - start_time;
|
||||||
|
|
||||||
this.logger.debug(`Last stats:`, stats);
|
this.logger.debug(`Last stats:`, stats);
|
||||||
reject({ error: err, stdout, stderr, output, stats });
|
reject({ error: err, stdout, stderr, output, stats, exec_time });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,13 +12,14 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/piston/packages:/piston/packages
|
- ./data/piston/packages:/piston/packages
|
||||||
environment:
|
environment:
|
||||||
- PISTON_REPO_URL=http://repo:8000/index
|
- PISTON_REPO_URL=https://github.com/engineer-man/piston/releases/download/pkgs/index
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- /piston/jobs:exec,uid=1000,gid=1000,mode=711
|
- /piston/jobs:exec,uid=1000,gid=1000,mode=711
|
||||||
|
|
||||||
repo: # Local testing of packages
|
repo:
|
||||||
|
# Local testing of packages
|
||||||
build: repo
|
build: repo
|
||||||
container_name: piston_repo
|
container_name: piston_repo
|
||||||
command: ['--no-build'] # Don't build anything
|
command: [ '--no-build' ] # Don't build anything
|
||||||
volumes:
|
volumes:
|
||||||
- .:/piston
|
- .:/piston
|
||||||
|
|
Loading…
Reference in New Issue