'Publish samples on RPC.
:param samples: Samples from pipeline after transformation.'

def publish_samples(self, samples):

    meters = [utils.meter_message_from_counter(sample, self.conf.publisher.telemetry_secret) for sample in samples]
    topic = self.conf.publisher_notifier.metering_topic
    self.local_queue.append((topic, meters))
    if self.per_meter_topic:
        for (meter_name, meter_list) in itertools.groupby(sorted(meters, key=operator.itemgetter('counter_name')), operator.itemgetter('counter_name')):
            meter_list = list(meter_list)
            topic_name = ((topic + '.') + meter_name)
            LOG.debug('Publishing    %(m)d    samples    on    %(n)s', {'m': len(meter_list), 'n': topic_name})
            self.local_queue.append((topic_name, meter_list))
    self.flush()
