North-Seattle-College / ad440-winter2021-thursday-repo

NSC AD 440 Winter 2021 Thursday cohort practicum repo
Apache License 2.0
2 stars 27 forks source link

[Task]Capture the time to load the users/{user_id}/tasks/{tasks _id} 40 times using Puppeteer with caching #293

Closed chonger878 closed 3 years ago

chonger878 commented 3 years ago

Is your feature request related to a problem? Please describe. This function should capture the time it takes to load this particular endpoint page 40 times. It will use Puppeteer to capture that.

Describe the solution you'd like In addition to downloading Puppeteer, I also wrote a method that will get the page metrics. That page metrics will be called 40 times.

Describe alternatives you've considered None.

Addition content I give credit to PR #315 for helping me to get this to work.

HOW TO TEST THE CODE (Copied from my PR...and I used cmd for this one) 1.) Navigate to test/ui 2.) Before starting, make sure you type npm install to load dependencies/whatever is needed (especially puppeteer, as I learned that the hard way). 3.) Type node capturetimetaskid.js (note: capturetimetaskid.js is the name of the file) 4.) You should be able to see 40 lines of output stating how long it takes to load the page at every iteration. When the program stops running, you should be able to see the average time it took to load the page 40 times. 5.) IMPORTANT: Please leave the caching disabled, as we will be using redis caching for that.

For example, this should be the expected output for user_id #2, task_id#1: Screenshot (267)

chonger878 commented 3 years ago

Date Task Time 3/22/21 Writing code to perform page loading 30 mins 3/24/21 Research/Continued writing code to capture time for page loading 2 hrs 3/25/21 Cleaned up code/Documentation 1 hour 3/26/21 Modified code/documentation 2 hours