def update_result(self, context):
        outfile = os.path.join(context.output_directory, 'hwuitest.output')
        with open(outfile, 'w') as wfh:
            wfh.write(self.output)
        context.add_artifact('hwuitest', outfile, kind='raw')

        normal = re.compile(r'(?P<value>\d*)(?P<unit>\w*)')
        with_pct = re.compile(r'(?P<value>\d*) \((?P<percent>.*)%\)')
        count = 0
        for line in self.output.splitlines():
            #Filters out "Success!" and blank lines
            try:
                metric, value_string = [p.strip() for p in line.split(':', 1)]
            except __HOLE__:
                continue

            # Filters out unwanted lines
            if metric in IGNORED_METRICS:
                continue

            if metric == "Janky frames":
                count += 1
                match = with_pct.match(value_string).groupdict()
                context.result.add_metric(metric,
                                          match['value'],
                                          None,
                                          classifiers={"loop": count,
                                                       "frames": self.frames})
                context.result.add_metric(metric + "_pct",
                                          match['value'],
                                          "%",
                                          classifiers={"loop": count,
                                                       "frames": self.frames})
            else:
                match = normal.match(value_string).groupdict()
                context.result.add_metric(metric,
                                          match['value'],
                                          match['unit'],
                                          classifiers={"loop": count,
                                                       "frames": self.frames})
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/workloads/hwuitest/__init__.py/HWUITest.update_result