From ec056d97e5fbe45e26a48468316c5d8b8bf6f385 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 30 Mar 2021 15:49:40 +0200 Subject: [PATCH] rplot: add total job time in the plots --- garlic/pp/rplot.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/garlic/pp/rplot.nix b/garlic/pp/rplot.nix index 262e6c4..9366fb0 100644 --- a/garlic/pp/rplot.nix +++ b/garlic/pp/rplot.nix @@ -3,6 +3,7 @@ , rWrapper , rPackages , fontconfig +, jq }: { @@ -21,7 +22,7 @@ let in stdenv.mkDerivation { name = "plot"; - buildInputs = [ customR ]; + buildInputs = [ customR jq ]; preferLocalBuild = true; dontPatchShebangs = true; phases = [ "installPhase" ]; @@ -32,5 +33,7 @@ in stdenv.mkDerivation { cd $out ln -s ${dataset} input Rscript --vanilla ${script} ${dataset} + jq -c .total_time input |\ + awk '{s+=$1} END {printf "%f\n", s/60}' > total_job_time_minutes ''; }