Skip to content

Commit

Permalink
Recalculate the fully loaded time once all of the requests are gathered
Browse files Browse the repository at this point in the history
Fix #94
  • Loading branch information
pmeenan committed Mar 30, 2018
1 parent 4c39d0d commit 217c36f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/support/devtools_parser.py
Expand Up @@ -815,6 +815,7 @@ def process_page_data(self):
page_data['responses_200'] = 0
page_data['responses_404'] = 0
page_data['responses_other'] = 0
page_data['fullyLoaded'] = 0
for request in requests:
if 'TTFB' not in page_data and 'load_start' in request and 'ttfb_ms' in request and \
request['ttfb_ms'] >= 0 and 'responseCode' in request and \
Expand Down Expand Up @@ -846,6 +847,9 @@ def process_page_data(self):
page_data['result'] = 99999
else:
page_data['responses_other'] += 1
end_time = request['load_start'] + request['load_ms']
if end_time > page_data['fullyLoaded']:
page_data['fullyLoaded'] = end_time
if page_data['responses_200'] == 0:
if len(requests) > 0 and 'responseCode' in requests[0]:
page_data['result'] = requests[0]['responseCode']
Expand Down

0 comments on commit 217c36f

Please sign in to comment.