def update_result(self, context):
        for sensor in self.sensors:
            try:
                report_type, units, conversion = HWMON_SENSORS[sensor.kind]
                if report_type == 'diff':
                    before, after = sensor.readings
                    diff = conversion(after - before)
                    context.result.add_metric(sensor.label, diff, units)
                elif report_type == 'before/after':
                    before, after = sensor.readings
                    mean = conversion(2 / (after + before))
                    context.result.add_metric(sensor.label, mean, units)
                    context.result.add_metric(sensor.label + ' before', conversion(before), units)
                    context.result.add_metric(sensor.label + ' after', conversion(after), units)
                else:
                    raise InstrumentError('Unexpected report_type: {}'.format(report_type))
            except ValueError, e:
                self.logger.error('Could not collect all {} readings for {}'.format(sensor.kind, sensor.label))
                self.logger.error('Got: {}'.format(e))
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/instrumentation/hwmon/__init__.py/HwmonInstrument.update_result/swapped operands of `/`