Measure list building and reading time

This commit is contained in:
Sam Carlton 2020-12-01 16:16:18 -06:00
parent 8d22db38bf
commit d0ae3234d5

View file

@ -31,6 +31,9 @@ const storeAppLists = async function (builder) {
const savedLists = await Promise.all(listsOptions.map(async list => {
const methodName = `Building ${list.path}`
console.time(methodName)
// Run the build method
const builtList = await list.buildMethod()
@ -49,6 +52,9 @@ const storeAppLists = async function (builder) {
const savedList = JSON.parse(savedListJSON)
console.timeEnd(methodName)
// Import the created JSON File
return savedList
}))
@ -84,6 +90,9 @@ export default {
},
routes() {
return Promise.all(listsOptions.map(async list => {
const methodName = `Reading ${list.path}`
console.time(methodName)
const listPath = `.${list.path}`
// Read JSON to ensure it exists
@ -92,6 +101,8 @@ export default {
// Parse the saved JSON into a variable
const savedList = JSON.parse(savedListJSON)
console.timeEnd(methodName)
// Pass on the variable
return savedList
}))