Created
July 13, 2017 03:20
-
-
Save alexander-bobin/c5ede25397d5687dd0276d9737f4610f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| url=${1:-http://localhost:8080/us/rock-n-roll-dallas/sammy} | |
| output_path="./.lighthouse/$(date +%F-%S.%M).json" | |
| NODE_ENV=production yarn build && NODE_ENV=production yarn start > dev.log & | |
| # may need to wait for port | |
| yarn run lighthouse ${url} -- --output="json" --output-path="${output_path}" | |
| kill $(lsof -i :8080 -t) | |
| meaningful_paint=$(jq '.audits | .["first-meaningful-paint"] | .rawValue' ${output_path}) | |
| speed_index=$(jq '.audits | .["speed-index-metric"] | .rawValue' ${output_path}) | |
| first_interactive=$(jq '.audits | .["first-interactive"] | .rawValue' ${output_path}) | |
| echo "First meaningful paint (ms): ${meaningful_paint}" | |
| echo "Speed index metric (ms): ${speed_index}" | |
| echo "First interactive (ms): ${first_interactive}" | |
| rm ${output_path} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment