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
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
def __init__(self, name, value): self.name = caseless_string(name) self.value = numeric(value)
def from_pod(pod): name, value_part = pod.split('(') return level(name, numeric(value_part.rstrip(')')))
def __init__(self, name, value): self.name = caseless_string(name) self.value = numeric(value)
def from_pod(pod): name, value_part = pod.split('(') return level(name, numeric(value_part.rstrip(')')))