def _format_metrics(self):
        """
        Build list of metrics formatted for the influxdb client.
        """
        metrics = []

        if self.using_0_8:
            for path in self.batch:
                metrics.append({
                    "points": [[metric.timestamp, metric.value] for metric in
                               self.batch[path]],
                    "name": path,
                    "columns": ["time", "value"]})
        else:
            for path in self.batch:
                for metric in self.batch[path]:
                    # Cast to float to ensure it's written as a float in
                    # InfluxDB. This prevents future errors where the data type
                    # of a field in InfluxDB is 'int', but we try to write a
                    # float to that field.
                    value = metric.value
                    if isinstance(value, integer_types):
                        value = float(value)

                    metrics.append({
                        "measurement": metric.getCollectorPath(),
                        "time": metric.timestamp,
                        "fields": {metric.getMetricPath(): value},
                        "tags": {"host": metric.host}
                    }),

        return metrics

        Build list of metrics formatted for the influxdb client.
        
src/diamond/handler/influxdbHandler.py