def _get_aggregate_metrics(self, flush_time=None):
        # Get rolled up metrics
        rolled_up_metrics = self._metric_aggregator.flush(flush_time)

        # FIXME: emit a dictionary from the aggregator
        metrics = []
        for timestamp, value, name, tags, host in rolled_up_metrics:
            metric_tags = tags
            metric_name = name

            # Append all client level tags to every metric
            if self.constant_tags:
                if tags:
                    metric_tags = tags + self.constant_tags
                else:
                    metric_tags = self.constant_tags

            # Resolve the metric name
            if self.namespace:
                metric_name = self.namespace + "." + name

            metric = {
                'metric': metric_name,
                'points': [[timestamp, value]],
                'type': MetricType.Gauge,
                'host': host,
                'device': self.device,
                'tags': metric_tags
            }
            metrics.append(metric)
        return metrics
Get, format and return the rolled up metrics from the aggregator.
dataset/ETHPy150Open DataDog/datadogpy/datadog/threadstats/base.py/ThreadStats._get_aggregate_metrics