def METHOD_NAME(self, measurement: Measurement) -> None:
    if self._view._attribute_keys is not None:
        attributes = {}
        for key, value in (measurement.attributes or {}).items():
            if key in self._view._attribute_keys:
                attributes[key] = value
    elif measurement.attributes is not None:
        attributes = measurement.attributes
    else:
        attributes = {}
    aggr_key = frozenset(attributes.items())
    if aggr_key not in self._attributes_aggregation:
        with self._lock:
            if aggr_key not in self._attributes_aggregation:
                if not isinstance(
                    self._view._aggregation, DefaultAggregation
                ):
                    aggregation = (
                        self._view._aggregation._create_aggregation(
                            self._instrument,
                            attributes,
                            self._start_time_unix_nano,
                        )
                    )
                else:
                    aggregation = self._instrument_class_aggregation[
                        self._instrument.__class__
                    ]._create_aggregation(
                        self._instrument,
                        attributes,
                        self._start_time_unix_nano,
                    )
                self._attributes_aggregation[aggr_key] = aggregation
    self._attributes_aggregation[aggr_key].aggregate(measurement)