Commit c883f502 authored by Jeremy Morrell's avatar Jeremy Morrell Committed by GitHub

Add new metrics logging (#408)

- Log every time the compile succeeds
- Add log information about which build scripts are being used
parent 3bebde81
...@@ -172,6 +172,7 @@ build_dependencies() { ...@@ -172,6 +172,7 @@ build_dependencies() {
run_if_present 'heroku-postbuild' run_if_present 'heroku-postbuild'
# TODO: run_if_present 'build' # TODO: run_if_present 'build'
log_build_scripts
} }
header "Building dependencies" header "Building dependencies"
...@@ -206,6 +207,7 @@ summarize_build() { ...@@ -206,6 +207,7 @@ summarize_build() {
} }
header "Build succeeded!" header "Build succeeded!"
mcount "compile"
summarize_build | output "$LOG_FILE" summarize_build | output "$LOG_FILE"
warn_no_start "$LOG_FILE" warn_no_start "$LOG_FILE"
......
...@@ -29,6 +29,36 @@ run_if_present() { ...@@ -29,6 +29,36 @@ run_if_present() {
fi fi
} }
log_build_scripts() {
local build=$(read_json "$BUILD_DIR/package.json" ".scripts[\"build\"]")
local heroku_prebuild=$(read_json "$BUILD_DIR/package.json" ".scripts[\"heroku-prebuild\"]")
local heroku_postbuild=$(read_json "$BUILD_DIR/package.json" ".scripts[\"heroku-postbuild\"]")
if [ -n "$build" ]; then
mcount "scripts.build"
if [ -z "$heroku_postbuild" ]; then
mcount "scripts.build-without-heroku-postbuild"
fi
fi
if [ -n "$heroku_prebuild" ]; then
mcount "scripts.heroku-prebuild"
fi
if [ -n "$heroku_postbuild" ]; then
mcount "scripts.heroku-postbuild"
fi
if [ -n "$heroku_postbuild" ] && [ -n "$build" ]; then
mcount "scripts.build-and-heroku-postbuild"
if [ "$heroku_postbuild" != "$build" ]; then
mcount "scripts.different-build-and-heroku-postbuild"
fi
fi
}
yarn_node_modules() { yarn_node_modules() {
local build_dir=${1:-} local build_dir=${1:-}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment