def add_type_hours(self, type_name, type_value, unit_hours):
        if type_value not in self.by_type[type_name]:
            self.by_type[type_name][type_value] = dict(count=0, unit_hours=0.0)
        cts = self.by_type[type_name][type_value]
        cts['count'] += 1
        cts['unit_hours'] += unit_hours
        cts['percent_count'] = (float(cts['count'])/self.count) * 100
        cts['percent_unit_hours'] = (cts['unit_hours']/self.unit_hours) * 100
dataset/ETHPy150Open openstack/stacktach/reports/instance_hours.py/InstanceHoursReport.add_type_hours/original