1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-19 04:21:17 +00:00

Merge pull request #304 from jimboatarm/uxperf-fix

UXPERF: handle error when only one timestamp is logged
This commit is contained in:
setrofim 2016-12-02 16:58:33 +00:00 committed by GitHub
commit b4036c5f15

View File

@ -229,20 +229,24 @@ class UxPerfParser(object):
''' '''
Creates a data frame containing fps metrics for a captured action. Creates a data frame containing fps metrics for a captured action.
''' '''
start, end = map(int, action) if len(action) == 2:
df = pd.read_csv(frames) start, end = map(int, action)
# SurfaceFlinger Algorithm df = pd.read_csv(frames)
if df.columns.tolist() == list(SurfaceFlingerFrame._fields): # pylint: disable=maybe-no-member # SurfaceFlinger Algorithm
field = 'actual_present_time' if df.columns.tolist() == list(SurfaceFlingerFrame._fields): # pylint: disable=maybe-no-member
# GfxInfo Algorithm field = 'actual_present_time'
elif df.columns.tolist() == list(GfxInfoFrame._fields): # pylint: disable=maybe-no-member # GfxInfo Algorithm
field = 'FrameCompleted' elif df.columns.tolist() == list(GfxInfoFrame._fields): # pylint: disable=maybe-no-member
field = 'FrameCompleted'
else:
field = ''
self.logger.error('frames.csv not in a recognised format. Cannot parse.')
if field:
df = df[start < df[field]]
df = df[df[field] <= end]
else: else:
field = '' self.logger.warning('Discarding action. Expected 2 timestamps, got {}!'.format(len(action)))
self.logger.error('frames.csv not in a recognised format. Cannot parse.') df = pd.DataFrame()
if field:
df = df[start < df[field]]
df = df[df[field] <= end]
return df return df
def _read(self, log): def _read(self, log):