Skip to content

Instantly share code, notes, and snippets.

@Nooshu
Last active October 8, 2020 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nooshu/ceac9b8ab43b27c2e2f27630369b5589 to your computer and use it in GitHub Desktop.
Save Nooshu/ceac9b8ab43b27c2e2f27630369b5589 to your computer and use it in GitHub Desktop.
Extract data from WebPageTest and filter out the obvious broken results
#!/usr/bin/env jq -rMf
# Extract other metrics from the run data
# Headers for resulting CSV
["TTFB", "First Contentful Paint", "Start Render", "DOM Complete" , "Fully Loaded"],
# drill down into the runs data
(
.data.runs
# convert the run data into an object and drill down into the run request data
| to_entries[].value.firstView
# filter out any obviously broken data
| select(.TTFB < 2200)
# build an array of the resulting data we want in the CSV
| [.TTFB, .firstContentfulPaint, .render, .domComplete, .fullyLoaded]
)
# pass to the CSV formatter
| @csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment