From 771332975560c192937300e5676c14caef069358 Mon Sep 17 00:00:00 2001 From: leeclemens Date: Thu, 23 Jan 2014 14:33:43 -0500 Subject: [PATCH] append newline to support _mem and multiple GPUs Memory used percentages were being concatenated into a single string if multiple GPUs were present, e.g. both using 30% would print mem0.value 3030 mem1.value --- plugins/gpu/nvidia_gpu_ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gpu/nvidia_gpu_ b/plugins/gpu/nvidia_gpu_ index 453c50fa..ad6605e6 100755 --- a/plugins/gpu/nvidia_gpu_ +++ b/plugins/gpu/nvidia_gpu_ @@ -180,7 +180,7 @@ case $name in totalMemGpu=`echo "$totalMemGpus" | sed -n $(( $nGpusCounter + 1 ))p` usedMemGpu=`echo "$usedMemGpus" | sed -n $(( $nGpusCounter + 1 ))p` percentMemUsed=$(( $usedMemGpu * 100 / $totalMemGpu )) - valueGpus="${valueGpus}${percentMemUsed}" + valueGpus="${valueGpus}${percentMemUsed}"$'\n' : $(( nGpusCounter = $nGpusCounter + 1 )) done ;;