#NEWLINE# def makePageMetricsTable( har_data ) : #NEWLINE# #INDENT# lines = [ ] #NEWLINE# lines . append ( '##BEGINTABLE: PAGE METRICS' ) #NEWLINE# lines . append ( ',' . join ( [ 'Page Name' , 'DOMContentLoad Time' , 'OnLoad Time' , 'Total CSS Time' , 'Number of Style Recalculates' , 'Number of Paints' ] ) ) #NEWLINE# for page_data in har_data : #NEWLINE# #INDENT# page = page_data [ 'log' ] [ 'pages' ] [ 0 ] #NEWLINE# lines . append ( ',' . join ( [ page [ '_pageName' ] , str ( page [ 'pageTimings' ] [ 'onContentLoad' ] ) , str ( page [ 'pageTimings' ] [ 'onLoad' ] ) , str ( page [ '_cssStats' ] [ '_totalTime' ] ) , str ( page [ '_eventStats' ] [ '_styleRecalculates' ] ) , str ( page [ '_eventStats' ] [ '_paints' ] ) ] ) ) #NEWLINE# #UNINDENT# lines . append ( '##ENDTABLE: PAGE METRICS' ) #NEWLINE# return '\n' . join ( page_data )