예제 #1
0
 def process_raw(filepath, *args):
     metrics = []
     dump = gfxinfo_get_last_dump(filepath)
     seen_stats = False
     for line in dump.split('\n'):
         if seen_stats and not line.strip():
             break
         elif line.startswith('Janky frames:'):
             text = line.split(': ')[-1]
             val_text, pc_text = text.split('(')
             metrics.append(DerivedMetric('janks', numeric(val_text.strip()), 'count'))
             metrics.append(DerivedMetric('janks_pc', numeric(pc_text[:-3]), 'percent'))
         elif ' percentile: ' in line:
             ptile, val_text = line.split(' percentile: ')
             name = 'render_time_{}_ptile'.format(ptile)
             value = numeric(val_text.strip()[:-2])
             metrics.append(DerivedMetric(name, value, 'time_ms'))
         elif line.startswith('Number '):
             name_text, val_text = line.strip().split(': ')
             name = name_text[7:].lower().replace(' ', '_')
             value = numeric(val_text)
             metrics.append(DerivedMetric(name, value, 'count'))
         else:
             continue
         seen_stats = True
     return metrics
예제 #2
0
파일: fps.py 프로젝트: bjackman/devlib
 def process_raw(filepath, *args):
     metrics = []
     dump = gfxinfo_get_last_dump(filepath)
     seen_stats = False
     for line in dump.split('\n'):
         if seen_stats and not line.strip():
             break
         elif line.startswith('Janky frames:'):
             text = line.split(': ')[-1]
             val_text, pc_text = text.split('(')
             metrics.append(DerivedMetric('janks', numeric(val_text.strip()), 'count'))
             metrics.append(DerivedMetric('janks_pc', numeric(pc_text[:-3]), 'percent'))
         elif ' percentile: ' in line:
             ptile, val_text = line.split(' percentile: ')
             name = 'render_time_{}_ptile'.format(ptile)
             value = numeric(val_text.strip()[:-2])
             metrics.append(DerivedMetric(name, value, 'time_ms'))
         elif line.startswith('Number '):
             name_text, val_text = line.strip().split(': ')
             name = name_text[7:].lower().replace(' ', '_')
             value = numeric(val_text)
             metrics.append(DerivedMetric(name, value, 'count'))
         else:
             continue
         seen_stats = True
     return metrics
예제 #3
0
 def __init__(self, name, value):
     self.name = caseless_string(name)
     self.value = numeric(value)
예제 #4
0
 def from_pod(pod):
     name, value_part = pod.split('(')
     return level(name, numeric(value_part.rstrip(')')))
예제 #5
0
 def __init__(self, name, value):
     self.name = caseless_string(name)
     self.value = numeric(value)
예제 #6
0
 def from_pod(pod):
     name, value_part = pod.split('(')
     return level(name, numeric(value_part.rstrip(')')))