def publish(self, name, value, raw_value=None, precision=0,
                metric_type='GAUGE', instance=None, timestamp=None):
        """
        Publish a metric with the given name at the given time.
        """
        if not self.metric_allowed(name):
            # whitelist / blacklist
            return

        # Get metric Path
        path = self.get_metric_path(name, instance=instance)

        # Get metric TTL
        ttl = float(self.config['interval']) * float(
            self.config['ttl_multiplier'])

        # Create Metric
        try:
            metric = Metric(path, value, raw_value=raw_value,
                            timestamp=timestamp, precision=precision,
                            host=self.get_hostname(), metric_type=metric_type,
                            ttl=ttl)
        except DiamondException:
            self.log.error(('Error when creating new Metric: path=%r, '
                            'value=%r'), path, value)
            raise

        # Publish Metric
        self.publish_metric(metric)

        Publish a metric with the given name at the given time.
        
src/diamond/collector.py