def update_result(self, context):  # NOQA
        super(GlbCorp, self).update_result(context)
        self.monitor.stop()
        iteration = 0
        results = []
        with open(self.logcat_log) as fh:
            try:
                line = fh.next()
                result_lines = []
                while True:
                    if OLD_RESULT_START_REGEX.search(line):
                        self.preamble_regex = OLD_PREAMBLE_REGEX
                        self.result_start_regex = OLD_RESULT_START_REGEX
                    elif NEW_RESULT_START_REGEX.search(line):
                        self.preamble_regex = NEW_PREAMBLE_REGEX
                        self.result_start_regex = NEW_RESULT_START_REGEX

                    if self.result_start_regex and self.result_start_regex.search(line):
                        result_lines.append('{')
                        line = fh.next()
                        while self.preamble_regex.search(line):
                            result_lines.append(self.preamble_regex.sub('', line))
                            line = fh.next()
                        try:
                            result = json.loads(''.join(result_lines))
                            results.append(result)
                            if iteration:
                                suffix = '_{}'.format(iteration)
                            else:
                                suffix = ''
                            for sub_result in result['results']:
                                frames = sub_result['score']
                                elapsed_time = sub_result['elapsed_time'] / 1000
                                fps = frames / elapsed_time
                                context.result.add_metric('score' + suffix, frames, 'frames')
                                context.result.add_metric('fps' + suffix, fps)
                        except ValueError:
                            self.logger.warning('Could not parse result for iteration {}'.format(iteration))
                        result_lines = []
                        iteration += 1
                    line = fh.next()
            except __HOLE__:
                pass  # EOF
        if results:
            outfile = os.path.join(context.output_directory, 'glb-results.json')
            with open(outfile, 'wb') as wfh:
                json.dump(results, wfh, indent=4)
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/workloads/glbcorp/__init__.py/GlbCorp.update_result