From ef8b2f3067c5addc05e79667d33380e4c194088b Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Thu, 28 Jan 2016 12:42:03 +0700 Subject: [PATCH] new: dev: added some more logs when compiling to monitor evolution of performance. --- bin/compose | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/compose b/bin/compose index 8e594d6..ad1c0f2 100755 --- a/bin/compose +++ b/bin/compose @@ -311,10 +311,12 @@ get_docker_compose () { ## declare -A entries + start_compilation=$SECONDS debug "Compiling 'docker-compose.conf' base for $DARKYELLOW$@$NORMAL..." for target_service in "$@"; do + start=$SECONDS services=$(get_ordered_service_dependencies "$target_service") || return 1 - debug "$DARKYELLOW$target_service$NORMAL deps:$DARKYELLOW" $services "$NORMAL" + debug " $DARKYELLOW$target_service$NORMAL deps:$DARKYELLOW" $services "$NORMAL $GRAY(in $((SECONDS - start)))s$NORMAL" for service in $services; do if [ "${entries[$service]}" ]; then @@ -326,14 +328,17 @@ get_docker_compose () { ## mark the service as "loaded" as well as it's containers ## if this is a subordinate service + start_service=$SECONDS entries[$service]=$(_get_docker_compose_service_mixin "$service") || return 1 + debug " Applied $DARKYELLOW$service$NORMAL charm metadata mixins $GRAY(in $((SECONDS - start_service)))s$NORMAL" done + debug " ..finished all mixins for $DARKYELLOW$target_service$NORMAL $GRAY(in $((SECONDS - start))s)$NORMAL" done merge_yaml_str "${entries[@]}" > "$cache_file" export _current_docker_compose="$(cat "$cache_file")" echo "$_current_docker_compose" - debug " ... Compilation of base 'docker-compose.conf' done." || true + debug " ..Compilation of base 'docker-compose.conf' done.$GRAY(in $((SECONDS - start_compilation))s)$NORMAL" || true # debug " ** ${WHITE}docker-compose.conf${NORMAL}:" # debug "$_current_docker_compose" }