Browse Source

new: dev: [compose-core] add some more timing in debug mode

master
Valentin Lab 2 weeks ago
parent
commit
30c3b0576c
  1. 29
      bin/compose-core

29
bin/compose-core

@ -5471,12 +5471,24 @@ aexport remainder_args
## Actual code
##
if [ -n "$DEBUG" ]; then
Elt "compute hashes"
start=$(time_now)
fi
COMPOSE_YML_FILE=$(get_compose_yml_location) || exit 1
COMPOSE_YML_CONTENT=$(get_compose_yml_content) || exit 1
COMPOSE_YML_CONTENT_HASH=$(compose:yml:hash) || exit 1
CHARM_STORE_HASH=$(charm.store_metadata_hash) || exit 1
COMBINED_HASH=$(H "$COMPOSE_YML_CONTENT_HASH" "$CHARM_STORE_HASH") || exit 1
export COMPOSE_YML_FILE COMPOSE_YML_CONTENT COMPOSE_YML_CONTENT_HASH CHARM_STORE_HASH COMBINED_HASH
if [ -n "$DEBUG" ]; then
elapsed="$(time_elapsed $start "$(time_now)")" || exit 1
print_info "$(printf "%.3fs" "$elapsed")"
Feedback
fi
charm.sanity_checks || die "Sanity checks about charm-store failed. Please correct."
##
@ -5821,6 +5833,10 @@ state:fields:resolve-parallel() {
export -f state:fields:resolve-parallel
if [ "$action" == "status" ]; then
if [ -n "$DEBUG" ]; then
start=$(time_now)
fi
if ! [ -t 1 ]; then
state_raw_output=1
fi
@ -6092,6 +6108,12 @@ if [ "$action" == "status" ]; then
echo " ${GRAY}..${NORMAL} ${WHITE}Exited${NORMAL} with errorlevel ${DARKRED}$E${NORMAL}" >&2
done
if [[ "${#errors[@]}" -gt 0 ]]; then
if [ -n "$DEBUG" ]; then
Elt "table computation ${DARKRED}failed${NORMAL}"
elapsed="$(time_elapsed $start "$(time_now)")" || exit 1
print_info "${elapsed}s"
Feedback
fi
exit 1
fi
@ -6122,7 +6144,12 @@ if [ "$action" == "status" ]; then
fi
done
fi
if [ -n "$DEBUG" ]; then
Elt "table computation ${GREEN}successful${NORMAL}"
elapsed="$(time_elapsed $start "$(time_now)")" || exit 1
print_info "${elapsed}s"
Feedback
fi
exit 0
fi

Loading…
Cancel
Save