def record(self, tags, measurement_map, timestamp, attachments=None):
        """records stats with a set of tags"""
        assert all(vv >= 0 for vv in measurement_map.values())
        for measure, value in measurement_map.items():
            if measure != self._registered_measures.get(measure.name):
                return
            view_datas = []
            for measure_name, view_data_list \
                    in self._measure_to_view_data_list_map.items():
                if measure_name == measure.name:
                    view_datas.extend(view_data_list)
            for view_data in view_datas:
                view_data.record(
                    context=tags, value=value, timestamp=timestamp,
                    attachments=attachments)
            self.export(view_datas)
records stats with a set of tags