'Write the data to the backend storage system.
:param data: a dictionary such as returned by
ceilometer.publisher.utils.meter_message_from_counter'

@api.wrap_db_retry(retry_interval=10, max_retries=10, retry_on_deadlock=True)
def record_metering_data(self, data):

    engine = self._engine_facade.get_engine()
    with engine.begin() as conn:
        m_id = self._create_meter(conn, data['counter_name'], data['counter_type'], data['counter_unit'])
        res_id = self._create_resource(conn, data['resource_id'], data['user_id'], data['project_id'], data['source'], data['resource_metadata'])
        sample = models.Sample.__table__
        conn.execute(sample.insert(), meter_id=m_id, resource_id=res_id, timestamp=data['timestamp'], volume=data['counter_volume'], message_signature=data['message_signature'], message_id=data['message_id'])
