rplot: add total job time in the plots

This commit is contained in:
Rodrigo Arias 2021-03-30 15:49:40 +02:00
parent 872ad1a289
commit ec056d97e5

View File

@ -3,6 +3,7 @@
, rWrapper , rWrapper
, rPackages , rPackages
, fontconfig , fontconfig
, jq
}: }:
{ {
@ -21,7 +22,7 @@ let
in stdenv.mkDerivation { in stdenv.mkDerivation {
name = "plot"; name = "plot";
buildInputs = [ customR ]; buildInputs = [ customR jq ];
preferLocalBuild = true; preferLocalBuild = true;
dontPatchShebangs = true; dontPatchShebangs = true;
phases = [ "installPhase" ]; phases = [ "installPhase" ];
@ -32,5 +33,7 @@ in stdenv.mkDerivation {
cd $out cd $out
ln -s ${dataset} input ln -s ${dataset} input
Rscript --vanilla ${script} ${dataset} Rscript --vanilla ${script} ${dataset}
jq -c .total_time input |\
awk '{s+=$1} END {printf "%f\n", s/60}' > total_job_time_minutes
''; '';
} }