#NEWLINE# def non_root_update_result( self , context ) : #NEWLINE# #INDENT# failed = [ ] #NEWLINE# with open ( self . logcat_log ) as logcat : #NEWLINE# #INDENT# metrics = OrderedDict ( ) #NEWLINE# for line in logcat : #NEWLINE# #INDENT# if ( 'VELLAMO RESULT:' in line ) : #NEWLINE# #INDENT# info = line . split ( ':' ) #NEWLINE# parts = info [ 2 ] . split ( ' ' ) #NEWLINE# metric = parts [ 1 ] . strip ( ) #NEWLINE# value = int ( parts [ 2 ] . strip ( ) ) #NEWLINE# metrics [ metric ] = value #NEWLINE# #UNINDENT# if ( 'VELLAMO ERROR:' in line ) : #NEWLINE# #INDENT# self . logger . warning ( 'Browser crashed during benchmark, results may not be accurate' ) #NEWLINE# #UNINDENT# #UNINDENT# for ( key , value ) in metrics . iteritems ( ) : #NEWLINE# #INDENT# key = key . replace ( ' ' , '_' ) #NEWLINE# context . result . add_metric ( key , value ) #NEWLINE# if ( value == 0 ) : #NEWLINE# #INDENT# failed . append ( key ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if failed : #NEWLINE# #INDENT# raise WorkloadError ( 'The following benchmark groups failed: {}' . format ( ', ' . join ( failed ) ) )