@staticmethod
    def series_for_meter(aggregates,
                         resource_name,
                         meter_name,
                         stats_name,
                         unit):
        series = []
        for resource in aggregates:
            if resource.get_meter(meter_name):
                point = {'unit': unit,
                         'name': getattr(resource, resource_name),
                         'data': []}
                for statistic in resource.get_meter(meter_name):
                    date = statistic.duration_end[:19]
                    value = float(getattr(statistic, stats_name))
                    point['data'].append({'x': date, 'y': value})
                series.append(point)
        return series
Construct datapoint series for a meter from resource aggregates.
dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/admin/metering/views.py/SamplesView.series_for_meter