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 ## Actual code
## ##
if [ -n "$DEBUG" ]; then
Elt "compute hashes"
start=$(time_now)
fi
COMPOSE_YML_FILE=$(get_compose_yml_location) || exit 1 COMPOSE_YML_FILE=$(get_compose_yml_location) || exit 1
COMPOSE_YML_CONTENT=$(get_compose_yml_content) || exit 1 COMPOSE_YML_CONTENT=$(get_compose_yml_content) || exit 1
COMPOSE_YML_CONTENT_HASH=$(compose:yml:hash) || exit 1 COMPOSE_YML_CONTENT_HASH=$(compose:yml:hash) || exit 1
CHARM_STORE_HASH=$(charm.store_metadata_hash) || exit 1 CHARM_STORE_HASH=$(charm.store_metadata_hash) || exit 1
COMBINED_HASH=$(H "$COMPOSE_YML_CONTENT_HASH" "$CHARM_STORE_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 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." 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 export -f state:fields:resolve-parallel
if [ "$action" == "status" ]; then if [ "$action" == "status" ]; then
if [ -n "$DEBUG" ]; then
start=$(time_now)
fi
if ! [ -t 1 ]; then if ! [ -t 1 ]; then
state_raw_output=1 state_raw_output=1
fi fi
@ -6092,6 +6108,12 @@ if [ "$action" == "status" ]; then
echo " ${GRAY}..${NORMAL} ${WHITE}Exited${NORMAL} with errorlevel ${DARKRED}$E${NORMAL}" >&2 echo " ${GRAY}..${NORMAL} ${WHITE}Exited${NORMAL} with errorlevel ${DARKRED}$E${NORMAL}" >&2
done done
if [[ "${#errors[@]}" -gt 0 ]]; then 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 exit 1
fi fi
@ -6122,7 +6144,12 @@ if [ "$action" == "status" ]; then
fi fi
done done
fi 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 exit 0
fi fi

Loading…
Cancel
Save