From d84da00b18f9f5d7dabe18997352f098b8c93799 Mon Sep 17 00:00:00 2001 From: Allen Wittenauer Date: Mon, 20 Jul 2015 09:42:01 -0700 Subject: [PATCH] HADOOP-12157. test-patch should report max memory consumed (Kengo Seki via aw) --- dev-support/test-patch.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 24dafc34178..25e86495ae3 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -386,6 +386,23 @@ function finish_docker_stats fi } +## @description Put the max memory consumed by maven at the bottom of the table. +## @audience private +## @stability stable +## @replaceable no +function finish_footer_table +{ + local maxmem + + # shellcheck disable=SC2016,SC2086 + maxmem=$(find "${PATCH_DIR}" -type f -exec ${AWK} 'match($0, /^\[INFO\] Final Memory: [0-9]+/) + { print substr($0, 22, RLENGTH-21) }' {} \; | sort -nr | head -n 1) + + if [[ -n ${maxmem} ]]; then + add_footer_table "Max memory used" "${maxmem}MB" + fi +} + ## @description Put the final elapsed time at the bottom of the table. ## @audience private ## @stability stable @@ -3473,6 +3490,8 @@ runtests finish_vote_table +finish_footer_table + output_to_console ${RESULT} output_to_bugsystem ${RESULT} cleanup_and_exit ${RESULT}